From 02e1e55c74a461ad73839ec14684285c7625700f Mon Sep 17 00:00:00 2001 From: Joseph Pan Date: Wed, 23 Aug 2017 21:34:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9wxbot=E7=9A=84=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/dingdangpath.py | 1 - client/wxbot.py | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/dingdangpath.py b/client/dingdangpath.py index b1f6f07..a26ab91 100755 --- a/client/dingdangpath.py +++ b/client/dingdangpath.py @@ -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)) diff --git a/client/wxbot.py b/client/wxbot.py index d058510..e9795df 100644 --- a/client/wxbot.py +++ b/client/wxbot.py @@ -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 @@ -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): @@ -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) @@ -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()