Skip to content

Commit efe035e

Browse files
authored
Merge branch 'master' into master
2 parents 327ad35 + 1990637 commit efe035e

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
long_description=README,
2525
long_description_content_type='text/markdown',
2626
author='404 Team@Knownsec',
27-
url='https://github.com/knownsec/zoomeye-python',
27+
url='https://github.com/knownsec/zoomeye-python', #
2828
packages=['zoomeye'],
2929
entry_points={'console_scripts': ['zoomeye=zoomeye.cli:main']},
3030
install_requires=DEPENDENCIES,

zoomeye/config.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313

1414
seconds_of_fiveday = 60 * 60 * 24 * 5
1515

16-
# save api key file and json web token file path
16+
# save api key file and json web token file path 保存API密钥文件和json web令牌文件路径
1717
ZOOMEYE_CONFIG_PATH = "~/.config/zoomeye/setting"
1818

19-
# save search dork data path
19+
# save search dork data path 保存搜索节点数据路径
2020
ZOOMEYE_CACHE_PATH = "~/.config/zoomeye/cache"
2121

22-
# cache expired time, five day
22+
# cache expired time, five day 缓存过期时间,5天
2323
EXPIRED_TIME = seconds_of_fiveday
2424

25-
# print data max length
25+
# print data max length 打印数据
2626
STRING_MAX_LENGTH = 23
2727

28-
# cache file name
28+
# cache file name缓存文件名
2929
FILE_NAME = "/{}_{}.json"
3030

3131

zoomeye/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def init(args):
6161
init_key(api_key)
6262
return
6363
# invalid parameter
64-
show.printf("input parameter error", color="red")
64+
show.printf("input parameter error!", color="red")
6565
show.printf("please run <zoomeye init -h> for help.", color="red")
6666

6767

zoomeye/plotlib.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"""
1313
import sys
1414
import math
15-
15+
import re
1616

1717
from zoomeye import config
1818

1919

20-
def char_by_atan(stat, at, color):
20+
def char_by_atan(stat, at, color):#用于根据给定的百分比值(at)和颜色(color),返回相应的字符,用于绘制饼状图的每个部分
2121
"""
2222
:param stat: list, all data and label
2323
:param at: float, percentage
@@ -31,7 +31,7 @@ def char_by_atan(stat, at, color):
3131
return char_by_atan(stat[1:], at - stat[0][1], color[1:])
3232

3333

34-
def show_pie_chart(stat):
34+
def show_pie_chart(stat):#用于显示饼状图
3535
"""
3636
print pie chart in terminal
3737
:param stat: list, all data and label
@@ -65,7 +65,7 @@ def show_pie_chart(stat):
6565
count += 1
6666

6767

68-
def unicode_output():
68+
def unicode_output():#用于检查当前的标准输出是否支持Unicode
6969
"""
7070
unicode standard output
7171
"""
@@ -75,7 +75,7 @@ def unicode_output():
7575
)
7676

7777

78-
def trim_zeros(lst):
78+
def trim_zeros(lst):#用于去除列表(lst)末尾的零元素
7979
"""
8080
8181
"""
@@ -87,7 +87,7 @@ def trim_zeros(lst):
8787
return lst[:-k] if k > 0 else lst
8888

8989

90-
def get_matrix(counts, max_size, bar_width):
90+
def get_matrix(counts, max_size, bar_width):#用于生成直方图的矩阵表示,用于绘制直方图
9191
"""
9292
get the length of the histogram corresponding to each data
9393
:param counts: list, all data
@@ -117,7 +117,7 @@ def get_matrix(counts, max_size, bar_width):
117117
return out
118118

119119

120-
def generate_histogram(values, labels=None, force_ascii=False):
120+
def generate_histogram(values, labels=None, force_ascii=False):#用于生成直方图
121121
"""
122122
print histogram in terminal
123123
take the largest data as the standard, that is, the largest data is the longest
@@ -134,20 +134,20 @@ def generate_histogram(values, labels=None, force_ascii=False):
134134
else:
135135
chars = [" ", "#", "#", "#", "#", "#", "#", "#", "#"]
136136

137-
ft = []
137+
fmt = []
138138
if labels is not None:
139139
cfmt = "{{:{}s}}".format(max([len(str(label)) for label in labels]))
140-
ft.append(cfmt)
140+
fmt.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-
ft.append("[" + cfmt + "]")
147+
fmt.append("[" + cfmt + "]")
148148

149-
ft.append("{}")
150-
ft = " ".join(ft)
149+
fmt.append("{}")
150+
fmt = " ".join(fmt)
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(ft.format(*data))
162+
out.append(fmt.format(*data))
163163
for item in out:
164164
print(' ' + item)
165165

zoomeye/show.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def printf(s, color="white"):
3232
}
3333

3434
# default color
35-
default = '\033[0m' # item default color
36-
print('{}{}{}'.format(colors.get(color, "WHITE"), s, default))
35+
Default = '\033[0m' # item default color
36+
print('{}{}{}'.format(colors.get(color, "WHITE"), s, Default))
3737

3838

3939
def print_filter(keys, data_list, data_total, condition=None):

0 commit comments

Comments
 (0)