优化代码结构 删除无用队列结果集参数

This commit is contained in:
shmilylty
2019-08-05 18:00:01 +08:00
parent 53213304e2
commit 11642edf6e
50 changed files with 332 additions and 502 deletions
+4 -8
View File
@@ -1,5 +1,4 @@
# coding=utf-8
import queue
import time
from common import utils
@@ -28,7 +27,7 @@ class Entrust(Query):
subdomains_find = utils.match_subdomain(self.domain, str(resp.json()))
self.subdomains = self.subdomains.union(subdomains_find)
def run(self, rx_queue):
def run(self):
"""
类执行入口
"""
@@ -37,21 +36,18 @@ class Entrust(Query):
self.save_json()
self.gen_result()
self.save_db()
rx_queue.put(self.results)
self.finish()
def do(domain, rx_queue): # 统一入口名字 方便多线程调用
def do(domain): # 统一入口名字 方便多线程调用
"""
类统一调用入口
:param str domain: 域名
:param rx_queue: 结果集队列
"""
query = Entrust(domain)
query.run(rx_queue)
query.run()
if __name__ == '__main__':
result_queue = queue.Queue()
do('example.com', result_queue)
do('example.com')