实现初始化表功能

This commit is contained in:
Jing Ling
2020-11-19 01:32:40 +08:00
parent c5c3d7a70d
commit ae6f8d4ec5
2 changed files with 9 additions and 0 deletions
+7
View File
@@ -771,3 +771,10 @@ def get_ns_path(in_china=None, enable_wildcard=None, ns_ip_list=None):
ns_data = '\n'.join(ns_ip_list) ns_data = '\n'.join(ns_ip_list)
save_to_file(path, ns_data) save_to_file(path, ns_data)
return path return path
def init_table(domain):
db = Database()
db.drop_table(domain)
db.create_table(domain)
db.close()
+2
View File
@@ -147,6 +147,8 @@ class OneForAll(object):
:return: subdomain results :return: subdomain results
:rtype: list :rtype: list
""" """
utils.init_table(self.domain)
if not self.access_internet: if not self.access_internet:
logger.log('ALERT', 'Because it cannot access the Internet, ' logger.log('ALERT', 'Because it cannot access the Internet, '
'OneForAll will not execute the subdomain collection module!') 'OneForAll will not execute the subdomain collection module!')