Skip to content

Commit e1c26df

Browse files
committed
add run_update public function to CodeExercise
1 parent bf27447 commit e1c26df

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/scwidgets/exercise/_widget_code_exercise.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,19 @@ def _on_click_update_action(self) -> bool:
649649

650650
return not (raised_error)
651651

652+
def run_update(self):
653+
"""
654+
Invokes an update run, the same that is invoked by a click on the update button
655+
or for :param update_mode: "release" and "continuous" when a parameter panel
656+
parameter is changed
657+
"""
658+
if self._update_button is not None:
659+
self._update_button.click()
660+
else:
661+
# we might be in update_mode "release" or "continuous" where no button is
662+
# displayed
663+
self._on_click_update_action()
664+
652665
def run_code(self, *args, **kwargs) -> Check.FunOutParamsT:
653666
"""
654667
Runs the `code` with the given (keyword) arguments and returns the output of the

0 commit comments

Comments
 (0)