@@ -43,6 +43,7 @@ def login(self, enableCmdQR=False, picDir=None, qrCallback=None, | |||
logger.warning('itchat has already logged in.') | |||
return | |||
self.isLogging = True | |||
logger.info('Ready to login.') | |||
while self.isLogging: | |||
uuid = push_login(self) | |||
if uuid: | |||
@@ -84,7 +85,7 @@ def login(self, enableCmdQR=False, picDir=None, qrCallback=None, | |||
if hasattr(loginCallback, '__call__'): | |||
r = loginCallback() | |||
else: | |||
utils.clear_screen() | |||
# utils.clear_screen() | |||
if os.path.exists(picDir or config.DEFAULT_QR): | |||
os.remove(picDir or config.DEFAULT_QR) | |||
logger.info('Login successfully as %s' % self.storageClass.nickName) | |||
@@ -28,7 +28,7 @@ def auto_login(self, hotReload=False, statusStorageDir='itchat.pkl', | |||
if rval:=self.load_login_status(statusStorageDir, | |||
loginCallback=loginCallback, exitCallback=exitCallback): | |||
return | |||
logger.error('hot reload failed, logging in normally, {}'.format(rval)) | |||
logger.error('Hot reload failed, logging in normally, error={}'.format(rval)) | |||
self.logout() | |||
self.login(enableCmdQR=enableCmdQR, picDir=picDir, qrCallback=qrCallback, | |||
loginCallback=loginCallback, exitCallback=exitCallback) | |||