Skip to content

Commit

Permalink
输出配置信息
Browse files Browse the repository at this point in the history
  • Loading branch information
JinnLynn committed May 9, 2012
1 parent 277ba83 commit c972ec5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion genpac.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -306,6 +312,8 @@ def CreatePacFile(gfwlistRules, userRules):

parseConfig()

printConfigInfo()

print "正在获取GFWList %s ..." % config['gfwUrl']
res, errorInfo = fetchGFWList()
if res == False:
Expand Down

0 comments on commit c972ec5

Please sign in to comment.