mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
typos
This commit is contained in:
@@ -732,25 +732,13 @@ def sort_by_subdomain(data):
|
|||||||
|
|
||||||
|
|
||||||
def ping(host, path):
|
def ping(host, path):
|
||||||
"""
|
|
||||||
|
|
||||||
:param host:
|
|
||||||
:param path:
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
param = '-n' if platform.system().lower() == 'windows' else '-c'
|
param = '-n' if platform.system().lower() == 'windows' else '-c'
|
||||||
|
|
||||||
command = ['ping', param, '3', host]
|
command = ['ping', param, '3', host]
|
||||||
with open(path, "w") as f:
|
with open(path, "w") as f:
|
||||||
return subprocess.call(command, stdout=f, stderr=f)
|
return subprocess.call(command, stdout=f, stderr=f)
|
||||||
|
|
||||||
|
|
||||||
def ping_avg_time(nameserver):
|
def ping_avg_time(nameserver):
|
||||||
"""
|
|
||||||
|
|
||||||
:param nameserver:
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
check_dir(settings.temp_save_dir)
|
check_dir(settings.temp_save_dir)
|
||||||
temp_path = settings.temp_save_dir.joinpath('ping')
|
temp_path = settings.temp_save_dir.joinpath('ping')
|
||||||
ping(nameserver, path=temp_path)
|
ping(nameserver, path=temp_path)
|
||||||
@@ -769,7 +757,6 @@ def ping_avg_time(nameserver):
|
|||||||
|
|
||||||
|
|
||||||
def auto_select_nameserver():
|
def auto_select_nameserver():
|
||||||
""""""
|
|
||||||
logger.log('INFOR', f'Ping test start, to select nameservers.')
|
logger.log('INFOR', f'Ping test start, to select nameservers.')
|
||||||
avg_time1 = ping_avg_time('114.114.114.114')
|
avg_time1 = ping_avg_time('114.114.114.114')
|
||||||
avg_time2 = ping_avg_time('8.8.8.8')
|
avg_time2 = ping_avg_time('8.8.8.8')
|
||||||
|
|||||||
Reference in New Issue
Block a user