Skip to content

Commit f863961

Browse files
authored
Merge pull request #97 from arimakaori/master
add chinese comments
2 parents b104225 + a83fcaf commit f863961

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

zoomeye/core.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
zoomeye_dir = os.path.expanduser(config.ZOOMEYE_CONFIG_PATH)
1717

1818

19-
def init_key(key):
19+
def init_key(key): #初始化API密钥并将其保存在本地配置文件中
20+
2021
"""
2122
initialize through the api key, write the api key to the local configuration file,
2223
theoretically it will never expire unless you remake the api key
@@ -43,7 +44,7 @@ def init_key(key):
4344
os.chmod(key_file, 0o600)
4445

4546

46-
def init(args):
47+
def init(args):#根据用户输入的参数来选择初始化方法,可以通过API密钥来进行初始化
4748
"""
4849
the initialization processing function will select the initialization method according to the user's input.
4950
:param args:
@@ -59,7 +60,7 @@ def init(args):
5960
show.printf("please run <zoomeye init -h> for help.", color="red")
6061

6162

62-
def search(args):
63+
def search(args):#进行搜索操作,根据用户输入的搜索条件进行搜索
6364
dork = args.dork
6465
num = int(args.num)
6566
facet = args.facet
@@ -93,7 +94,7 @@ def search(args):
9394
show.printf("please run <zoomeye search -h> for help.")
9495

9596

96-
def info(args):
97+
def info(args):#打印当前用户的身份和本月剩余的数据配额
9798
"""
9899
used to print the current identity of the user and the remaining data quota for the month
99100
:param args:
@@ -111,7 +112,7 @@ def info(args):
111112
show.printf("quota_info: {}".format(user_data["quota_info"]))
112113

113114

114-
def ip_history(args):
115+
def ip_history(args):#查询设备的历史信息
115116
"""
116117
query device history
117118
please see: https://www.zoomeye.org/doc#history-ip-search
@@ -141,7 +142,7 @@ def ip_history(args):
141142
zm.show_fields()
142143

143144

144-
def clear_file(args):
145+
def clear_file(args):#清除用户设置和ZoomEye缓存数据
145146
"""
146147
clear user setting and zoomeye cache data
147148
"""
@@ -165,7 +166,7 @@ def clear_file(args):
165166
show.printf("clear complete!", color='green')
166167

167168

168-
def information_ip(args):
169+
def information_ip(args):#获取特定IP的信息
169170
ip = args.ip
170171
filters = args.filter
171172
# determine whether the input is an IP address by regular
@@ -185,7 +186,7 @@ def information_ip(args):
185186
infor.show_information()
186187

187188

188-
def associated_domain_query(args):
189+
def associated_domain_query(args):#关联域名查询
189190
q = args.q
190191
resource = args.type
191192
page = args.page

zoomeye/data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def process_filter(fields, data, tables):
259259
return result_data, has_equal, not_equal
260260

261261

262-
class Cache:
262+
class Cache:#用于缓存从API获取的数据或从本地文件中读取数据
263263
"""
264264
used to cache the data obtained from the api to the local,
265265
or directly clip the file from the local.
@@ -333,7 +333,7 @@ def update(self):
333333
pass
334334

335335

336-
class CliZoomEye:
336+
class CliZoomEye:#处理与ZoomEye搜索相关的功能,如默认显示、过滤、统计等
337337

338338
def __init__(self, dork, num, resource, facet=None, force=False):
339339
self.dork = dork
@@ -586,7 +586,7 @@ def count(self):
586586
show.printf(self.total)
587587

588588

589-
class HistoryDevice:
589+
class HistoryDevice:#处理获取主机历史数据的功能
590590
"""
591591
obtain the user's identity information and determine whether to use the IP history search function
592592
"""
@@ -704,7 +704,7 @@ def filter_fields(self, fields):
704704
show.print_filter_history(not_equal, result_data[:self.num], has_equal)
705705

706706

707-
class IPInformation:
707+
class IPInformation:#用于查询特定IP地址的信息
708708
"""
709709
query IP information
710710
"""
@@ -746,7 +746,7 @@ def filter_information(self, filters):
746746
show.print_info_filter(not_equal, result_data, has_equal)
747747

748748

749-
class DomainSearch:
749+
class DomainSearch:#用于查询相关域名或子域名
750750
"""
751751
query relation domain or sub domain
752752
"""

0 commit comments

Comments
 (0)