Feat/user script widget
Description
This MR introduces a widget to interact with user scripts in BEC. It provides a clean interface based on a QTreeWidget
with an embedded console and vscode widget for execution and editing scripts.
Related Issues
closes #393
Type of Change
- New Widget.
Potential side effects
While developing the widget, it became obvious that the general handling of scripts within BEC should be revisited. (A) How and where should scripts be executed. For the moment the widget executes scripts in its own BECConsole that is started. (B) The VSCodeEditor automatically saves files, which can get problematic for handling errors upon reloading the user scripts to update the UI. The usage of the update could be reviewed here. There were also a few occasions where reloading left the BEC client in a state which did not allow us to reload user scripts from within BEC. It seems to be linked with the namespace in the ipython client and 'forget_all_user_scripts()` method. Unfortunately, no reproducible way to trigger the problem could be established. (C) There is no proper monitoring for the execution of user scripts at the moment. At this point however, it is not yet clear whether this is responsibility of the UI or rather BEC client.
Definition of Done
A Short documentation was added.
-
Documentation is up-to-date.
Merge request reports
Activity
assigned to @appel_c
added 2 commits
added 27 commits
Toggle commit listadded 1 commit
- 2e5ee7c5 - test: fix tests, avoid spinning up VSCode and BECConsole
requested review from @guijar_m
requested review from @wyzula_j
368 """Cleanup the terminal""" 369 self.execute_command("\x03") # Ctrl-C 370 self.execute_command("exit()") 371 timeout = 5 372 interval = 0.1 373 timer = 0 374 # os.close(self.term.fd) 375 while self.term.fd is not None: 376 time.sleep(interval) 377 timer += interval 378 if timer > 0.8 * timeout: 379 logger.warning(f"Terminal still cleaning up after {timer:.1f} seconds") 380 if timer > timeout: 381 logger.error(f"Terminal cleanup timed out after {timeout} seconds") 382 break 383 self.deleteLater()