From 5b66711592251217269f2c23033402be8a51adaa Mon Sep 17 00:00:00 2001 From: vivre Date: Wed, 12 Oct 2016 17:57:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?test=5Fsync=5Fcheck=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_sync_check 兼容 --- wxbot.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/wxbot.py b/wxbot.py index b4d6a61..c7413be 100644 --- a/wxbot.py +++ b/wxbot.py @@ -1116,14 +1116,15 @@ class WXBot: return dic['BaseResponse']['Ret'] == 0 def test_sync_check(self): - for host in ['webpush.wx', 'webpush2.wx2','webpush.weixin', 'webpush2.weixin2']: - self.sync_host = host - try: - retcode = self.sync_check()[0] - except: - retcode == -1 - if retcode == '0': - return True + for host1 in ['webpush', 'webpush2']: + for host2 in ['weixin','weixin2','wx','wx2']: + self.sync_host = host1+host2 + try: + retcode = self.sync_check()[0] + except: + retcode == -1 + if retcode == '0': + return True return False def sync_check(self): From d9852039dbae8d39a5481e0eb987a55d8fc42645 Mon Sep 17 00:00:00 2001 From: vivre Date: Wed, 12 Oct 2016 18:01:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=BC=E5=AE=B9sync=EF=BC=8C=E8=A7=A3?= =?UTF-8?q?=E5=86=B31102=EF=BC=8C0=E5=92=8C-1=EF=BC=8C-1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容sync,解决1102,0和-1,-1问题 --- wxbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wxbot.py b/wxbot.py index c7413be..66ca144 100644 --- a/wxbot.py +++ b/wxbot.py @@ -1116,7 +1116,7 @@ class WXBot: return dic['BaseResponse']['Ret'] == 0 def test_sync_check(self): - for host1 in ['webpush', 'webpush2']: + for host1 in ['webpush.', 'webpush2.']: for host2 in ['weixin','weixin2','wx','wx2']: self.sync_host = host1+host2 try: