@@ -43,6 +43,7 @@ def login(self, enableCmdQR=False, picDir=None, qrCallback=None, | |||||
logger.warning('itchat has already logged in.') | logger.warning('itchat has already logged in.') | ||||
return | return | ||||
self.isLogging = True | self.isLogging = True | ||||
logger.info('Ready to login.') | |||||
while self.isLogging: | while self.isLogging: | ||||
uuid = push_login(self) | uuid = push_login(self) | ||||
if uuid: | if uuid: | ||||
@@ -84,7 +85,7 @@ def login(self, enableCmdQR=False, picDir=None, qrCallback=None, | |||||
if hasattr(loginCallback, '__call__'): | if hasattr(loginCallback, '__call__'): | ||||
r = loginCallback() | r = loginCallback() | ||||
else: | else: | ||||
utils.clear_screen() | |||||
# utils.clear_screen() | |||||
if os.path.exists(picDir or config.DEFAULT_QR): | if os.path.exists(picDir or config.DEFAULT_QR): | ||||
os.remove(picDir or config.DEFAULT_QR) | os.remove(picDir or config.DEFAULT_QR) | ||||
logger.info('Login successfully as %s' % self.storageClass.nickName) | 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, | if rval:=self.load_login_status(statusStorageDir, | ||||
loginCallback=loginCallback, exitCallback=exitCallback): | loginCallback=loginCallback, exitCallback=exitCallback): | ||||
return | 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.logout() | ||||
self.login(enableCmdQR=enableCmdQR, picDir=picDir, qrCallback=qrCallback, | self.login(enableCmdQR=enableCmdQR, picDir=picDir, qrCallback=qrCallback, | ||||
loginCallback=loginCallback, exitCallback=exitCallback) | loginCallback=loginCallback, exitCallback=exitCallback) | ||||