Skip to content

Commit

Permalink
从配置文件加载初始化参数功能
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   weixin.py
  • Loading branch information
sbilly committed Feb 22, 2016
1 parent 06c2fd8 commit 6f16d19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions weixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ def __init__(self):
opener.addheaders = [('User-agent', self.user_agent)]
urllib2.install_opener(opener)

def loadConfig(self, config):
if config['DEBUG']: self.DEBUG = config['DEBUG']
if config['autoReplyMode']: self.autoReplyMode = config['autoReplyMode']
if config['user_agent']: self.user_agent = config['user_agent']
if config['interactive']: self.interactive = config['interactive']

def getUUID(self):
url = 'https://login.weixin.qq.com/jslogin'
params = {
Expand Down

0 comments on commit 6f16d19

Please sign in to comment.