Skip to content

Commit 73b4763

Browse files
authored
Merge pull request #94 from ZhouRongqi/master
update the data.py
2 parents f37f69a + 7a4075c commit 73b4763

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

zoomeye/data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,11 +736,11 @@ def filter_information(self, filters):
736736
result_data, has_equal, not_equal = process_filter(filters, info_data, fields_ip)
737737
if len(result_data) == 0:
738738
return
739-
for item in not_equal:
740-
if fields_ip.get(item.strip()) is None:
739+
for items in not_equal:
740+
if fields_ip.get(items.strip()) is None:
741741
support_fields = ','.join(list(fields_ip.keys()))
742742
show.printf(
743-
"filter command has unsupport fields [{}], support fields has [{}]".format(item, support_fields),
743+
"filter command has unsupport fields [{}], support fields has [{}]".format(items, support_fields),
744744
color='red')
745745
exit(0)
746746
show.print_info_filter(not_equal, result_data, has_equal)

zoomeye/file.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ def get_api_key(path) -> str:
2424
:param path:
2525
:return:
2626
"""
27-
key_file = zoomeye_dir + "/apikey"
27+
key_fl = zoomeye_dir + "/apikey"
2828
# api key config does not exits
2929
# raise FileNotFoundError
30-
if not os.path.exists(key_file):
30+
if not os.path.exists(key_fl):
3131
raise FileNotFoundError("not found api key config")
3232
# determine whether the permission of the configuration file is read-only,
3333
# if not, set it to read-only
34-
if not oct(os.stat(key_file).st_mode).endswith("600"):
35-
os.chmod(key_file, 0o600)
34+
if not oct(os.stat(key_fl).st_mode).endswith("600"):
35+
os.chmod(key_fl, 0o600)
3636
# return read file content
37-
with open(key_file, 'r') as f:
37+
with open(key_fl, 'r') as f:
3838
return f.read().strip()
3939

4040

@@ -44,19 +44,19 @@ def get_jwt_token(path) -> str:
4444
:param path:
4545
:return:
4646
"""
47-
key_file = zoomeye_dir + "/jwt"
47+
key_fl = zoomeye_dir + "/jwt"
4848
# json web token does not exits
4949
# raise FileNotFoundError
50-
if not os.path.exists(key_file):
50+
if not os.path.exists(key_fl):
5151
raise FileNotFoundError("not found access token config")
5252

5353

5454
# determine whether the permission of the configuration file is read-only,
5555
# if not, set it to read-only
56-
if not oct(os.stat(key_file).st_mode).endswith("600"):
57-
os.chmod(key_file, 0o600)
56+
if not oct(os.stat(key_fl).st_mode).endswith("600"):
57+
os.chmod(key_fl, 0o600)
5858
# return read config content
59-
with open(key_file, 'r') as f:
59+
with open(key_fl, 'r') as f:
6060
return f.read().strip()
6161

6262

zoomeye/plotlib.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,20 @@ def generate_histogram(values, labels=None, force_ascii=False):
134134
else:
135135
chars = [" ", "#", "#", "#", "#", "#", "#", "#", "#"]
136136

137-
fmt = []
137+
ft = []
138138
if labels is not None:
139139
cfmt = "{{:{}s}}".format(max([len(str(label)) for label in labels]))
140-
fmt.append(cfmt)
140+
ft.append(cfmt)
141141
# show values
142142
all_int = all(val == int(val) for val in values)
143143
if all_int:
144144
cfmt = "{{:{}d}}".format(max([len(str(val)) for val in values]))
145145
else:
146146
cfmt = "{}"
147-
fmt.append("[" + cfmt + "]")
147+
ft.append("[" + cfmt + "]")
148148

149-
fmt.append("{}")
150-
fmt = " ".join(fmt)
149+
ft.append("{}")
150+
ft = " ".join(ft)
151151

152152
out = []
153153
for k, (val, row) in enumerate(zip(values, matrix)):
@@ -159,7 +159,7 @@ def generate_histogram(values, labels=None, force_ascii=False):
159159
# cut off trailing zeros
160160
r = trim_zeros(row)
161161
data.append("".join(chars[item] for item in r))
162-
out.append(fmt.format(*data))
162+
out.append(ft.format(*data))
163163
for item in out:
164164
print(' ' + item)
165165

0 commit comments

Comments
 (0)