diff --git a/tasks/assignment/assignment.py b/tasks/assignment/assignment.py index a3449dc4c..eafc4c555 100644 --- a/tasks/assignment/assignment.py +++ b/tasks/assignment/assignment.py @@ -132,16 +132,18 @@ class Assignment(AssignmentClaim, SynthesizeUI): return remain for group in self._iter_groups(): self.goto_group(group) + insight = False for assignment in self._iter_entries(): if assignment in self.dispatched: continue logger.hr('Assignment all', level=2) logger.info(f'Check assignment all: {assignment}') - self.goto_entry(assignment) + self.goto_entry(assignment, insight) status = self._check_assignment_status() if status == AssignmentStatus.CLAIMABLE: self.claim(assignment, None, should_redispatch=False) remain += 1 + insight = True # Order of entries change after claiming continue if status == AssignmentStatus.DISPATCHED: self.dispatched[assignment] = datetime.now() + \ @@ -191,12 +193,14 @@ class Assignment(AssignmentClaim, SynthesizeUI): if not isinstance(group, AssignmentEventGroup): continue self.goto_group(group) + insight = False for assignment in self._iter_entries(): if assignment in self.dispatched: continue logger.hr('Assignment event', level=2) logger.info(f'Check assignment event: {assignment}') - self.goto_entry(assignment) + self.goto_entry(assignment, insight) + insight = True status = self._check_assignment_status() # Should only be dispatchable or locked after _check_all if status == AssignmentStatus.DISPATCHABLE: diff --git a/tasks/assignment/ui.py b/tasks/assignment/ui.py index 6cd8e9762..8aef740a0 100644 --- a/tasks/assignment/ui.py +++ b/tasks/assignment/ui.py @@ -140,10 +140,11 @@ class AssignmentUI(UI): if ASSIGNMENT_GROUP_SWITCH.set(group, self): self._wait_until_entry_loaded() - def goto_entry(self, entry: AssignmentEntry): + def goto_entry(self, entry: AssignmentEntry, insight: bool = True): """ Args: entry (AssignmentEntry): + insight (bool): skip ocr to save time if insight is False Examples: self = AssignmentUI('src') @@ -160,7 +161,7 @@ class AssignmentUI(UI): raise ScriptError(err_msg) else: self.goto_group(entry.group) - ASSIGNMENT_ENTRY_LIST.select_row(entry, self) + ASSIGNMENT_ENTRY_LIST.select_row(entry, self, insight=insight) def _wait_until_group_loaded(self): skip_first_screenshot = True