From c972ec57432d8837d13c666644bb93a57e449b4d Mon Sep 17 00:00:00 2001 From: JinnLynn Date: Wed, 9 May 2012 16:40:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=87=BA=E9=85=8D=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genpac.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/genpac.py b/genpac.py index d1a48da5..3d892e97 100755 --- a/genpac.py +++ b/genpac.py @@ -57,6 +57,13 @@ def parseConfig(): except Exception, e: print e +def printConfigInfo(): + print "配置信息: " + print 'GFWList Proxy: Type: %s, Host: %s, Port: %s , Usr: %s, Pwd: %s' % (config['gfwProxyType'], + config['gfwProxyHost'], config['gfwProxyPort'], + config['gfwProxyUsr'], config['gfwProxyPwd']) + print "PAC Proxy String: %s" % generateProxyVar() + def fetchGFWList(): global gfwlistContent import socks, socket, urllib2 @@ -293,7 +300,6 @@ def CreatePacFile(gfwlistRules, userRules): with open('test/genpac.js', 'w') as js: js.write(pacContent) - if __name__ == "__main__": print '''/** * PAC Generator %s by JinnLynn http://jeeker.net @@ -306,6 +312,8 @@ def CreatePacFile(gfwlistRules, userRules): parseConfig() + printConfigInfo() + print "正在获取GFWList %s ..." % config['gfwUrl'] res, errorInfo = fetchGFWList() if res == False: