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

Commit

Permalink
修改wxbot的路径获取方式
Browse files Browse the repository at this point in the history
  • Loading branch information
wzpan committed Aug 23, 2017
1 parent 7964365 commit 02e1e55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion client/dingdangpath.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8-*-
import os

# Dingdang main directory
APP_PATH = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), os.pardir))
Expand Down
9 changes: 5 additions & 4 deletions client/wxbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import time
import re
import random
import dingdangpath
from traceback import format_exc
from requests.exceptions import ConnectionError, ReadTimeout
import HTMLParser
Expand Down Expand Up @@ -41,7 +42,7 @@ def show_image(file_path):
command = "open -a /Applications/Preview.app %s&" % quote(file_path)
os.system(command)
else:
webbrowser.open(os.path.join(os.getcwd(),'temp',file_path))
webbrowser.open(os.path.join(dingdangpath.TEMP_PATH, file_path))


class SafeSession(requests.Session):
Expand Down Expand Up @@ -92,9 +93,9 @@ def __init__(self):
self.cursor = 0 #拉取联系人信息的游标
self.is_big_contact = False #通讯录人数过多,无法直接获取
#文件缓存目录
self.temp_pwd = os.path.join(os.getcwd(),'temp')
self.temp_pwd = dingdangpath.TEMP_PATH
#登录图片所在目录
self.login_pwd = os.path.join(os.getcwd(),'login')
self.login_pwd = dingdangpath.LOGIN_PATH
if os.path.exists(self.temp_pwd) == False:
os.makedirs(self.temp_pwd)

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

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

result = self.wait4login()
Expand Down

0 comments on commit 02e1e55

Please sign in to comment.