diff --git a/module/ocr/ocr.py b/module/ocr/ocr.py index fd5711db8..af0d26887 100644 --- a/module/ocr/ocr.py +++ b/module/ocr/ocr.py @@ -283,7 +283,7 @@ class Duration(Ocr): @cached_property def timedelta_regex(self): regex_str = { - 'ch': r'\D*((?P\d{1,2})天)?((?P\d{1,2})小时)?((?P\d{1,2})分钟)?((?P\d{1,2})秒})?', + 'ch': r'\D*((?P\d{1,2})天)?((?P\d{1,2})小时)?((?P\d{1,2})分钟)?((?P\d{1,2})秒)?', 'en': r'\D*((?P\d{1,2})d\s*)?((?P\d{1,2})h\s*)?((?P\d{1,2})m\s*)?((?P\d{1,2})s)?' }[self.lang] return re.compile(regex_str) diff --git a/tasks/assignment/assignment.py b/tasks/assignment/assignment.py index b9dd97a78..24191c754 100644 --- a/tasks/assignment/assignment.py +++ b/tasks/assignment/assignment.py @@ -26,6 +26,7 @@ class Assignment(AssignmentClaim, SynthesizeUI): if duration is None: duration = self.config.Assignment_Duration + self.dispatched = dict() self.ensure_scroll_top(page_menu) self.ui_ensure(page_assignment) # Iterate in user-specified order, return undispatched ones @@ -103,6 +104,8 @@ class Assignment(AssignmentClaim, SynthesizeUI): if self.appear(DISPATCHED): self.dispatched[assignment] = datetime.now() + Duration( OCR_ASSIGNMENT_TIME).ocr_single_line(self.device.image) + if total == len(self.dispatched): + return remain continue break return remain