Skip to content
This repository has been archived by the owner on Apr 13, 2018. It is now read-only.

Commit

Permalink
接入二维码扫描页面(#19);二维码扫描路径挪至login目录
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Aug 22, 2017
1 parent 5408ecb commit 7964365
Show file tree
Hide file tree
Showing 7 changed files with 551 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ userInfo
wget-log*

# some thirdparty libs
client/mic_array
client/mic_array
login/wxqr.png
1 change: 1 addition & 0 deletions client/dingdangpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

DATA_PATH = os.path.join(APP_PATH, "static")
LIB_PATH = os.path.join(APP_PATH, "client")
LOGIN_PATH = os.path.join(APP_PATH, "login")
TEMP_PATH = os.path.join(APP_PATH, "temp")
PLUGIN_PATH = os.path.join(LIB_PATH, "plugins")

Expand Down
4 changes: 3 additions & 1 deletion client/wxbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def __init__(self):
self.is_big_contact = False #通讯录人数过多,无法直接获取
#文件缓存目录
self.temp_pwd = os.path.join(os.getcwd(),'temp')
#登录图片所在目录
self.login_pwd = os.path.join(os.getcwd(),'login')
if os.path.exists(self.temp_pwd) == False:
os.makedirs(self.temp_pwd)

Expand Down Expand Up @@ -1172,7 +1174,7 @@ def search_content(key, content, fmat='attr'):

def run(self, Mic=None):
self.get_uuid()
self.gen_qr_code(os.path.join(self.temp_pwd,'wxqr.png'))
self.gen_qr_code(os.path.join(self.login_pwd,'wxqr.png'))
print '[INFO] Please use WeChat to scan the QR code .'

result = self.wait4login()
Expand Down
2 changes: 1 addition & 1 deletion dingdang.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def run(self):
# create wechat robot
if self.config['wechat']:
self.wxBot = WechatBot(conversation.brain)
self.wxBot.DEBUG = True
self.wxBot.DEBUG = False
self.wxBot.conf['qr'] = 'tty'
conversation.wxbot = self.wxBot
t = threading.Thread(target=self.start_wxbot)
Expand Down
Loading

0 comments on commit 7964365

Please sign in to comment.