From 23dc81abf77d7683ac0af5f11b6ba8dec7de5c7d Mon Sep 17 00:00:00 2001 From: jose Date: Thu, 17 Jun 2021 09:57:55 +0800 Subject: [PATCH] Optimize node selection --- class/public.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/class/public.py b/class/public.py index a8cc1f4b..cd6df0db 100644 --- a/class/public.py +++ b/class/public.py @@ -80,23 +80,23 @@ def http_get_home(url,timeout,ex): res = HttpGet(new_url,timeout,headers) if res: writeFile("data/home_host.pl",host) - set_home_host(host) + # set_home_host(host) return res return ex except: return ex -def set_home_host(host): - """ - @name 设置官网hosts - @author hwliang - @param host IP地址 - @return void - """ - ExecShell('sed -i "/www.bt.cn/d" /etc/hosts') - ExecShell("echo '' >> /etc/hosts") - ExecShell("echo '%s www.bt.cn' >> /etc/hosts" % host) - ExecShell('sed -i "/^\s*$/d" /etc/hosts') +# def set_home_host(host): +# """ +# @name 设置官网hosts +# @author hwliang +# @param host IP地址 +# @return void +# """ +# ExecShell('sed -i "/www.bt.cn/d" /etc/hosts') +# ExecShell("echo '' >> /etc/hosts") +# ExecShell("echo '%s www.bt.cn' >> /etc/hosts" % host) +# ExecShell('sed -i "/^\s*$/d" /etc/hosts') def httpGet(url,timeout=6): return HttpGet(url,timeout) @@ -145,7 +145,7 @@ def http_post_home(url,data,timeout,ex): res = HttpPost(new_url, data, timeout, headers) if res: writeFile("data/home_host.pl", host) - set_home_host(host) + # set_home_host(host) return res return ex except: return ex