From af76a1602af081736b395b163e66cdf22ea9df14 Mon Sep 17 00:00:00 2001 From: SuperSonic Date: Sun, 25 Aug 2019 02:44:17 +0800 Subject: [PATCH] Update --- libs/data.py | 2 ++ libs/yuuki.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/data.py b/libs/data.py index 3b1f9a7..432f0a4 100644 --- a/libs/data.py +++ b/libs/data.py @@ -144,6 +144,8 @@ class Yuuki_Data: def getSEGroup(self, GroupID): SEMode = self.getGroup(GroupID)["SEGroup"] + if SEMode == None: + return None SEMode_ = {} for Mode in SEMode: SEMode_[int(Mode)] = SEMode[Mode] diff --git a/libs/yuuki.py b/libs/yuuki.py index ba10aaa..3df3e62 100644 --- a/libs/yuuki.py +++ b/libs/yuuki.py @@ -408,10 +408,13 @@ class Yuuki: NoWork = 0 catchedNews = [] ncMessage = Operation() - LastResetLimitTime = 0 + LastResetLimitTime = time.localtime().tm_hour Revision = self.client.getLastOpRevision() while True: try: + if time.localtime().tm_hour != LastResetLimitTime: + LastResetLimitTime = time.localtime().tm_hour + self.limitReset() if NoWork == 300: Revision = self.client.getLastOpRevision() catchedNews = self.listen.fetchOperations(Revision, 50)