@@ -218,6 +218,8 @@ def __init__(self, parent, name=None, run_workbox=False, standalone=False):
218218 self .uiGroup8ACT .triggered .connect (partial (self .gotoGroupByIndex , 8 ))
219219 self .uiGroupLastACT .triggered .connect (partial (self .gotoGroupByIndex , - 1 ))
220220
221+ self .uiRunFirstWorkboxACT .triggered .connect (self .run_first_workbox )
222+
221223 self .uiFocusNameACT .triggered .connect (self .show_focus_name )
222224
223225 self .uiCommentToggleACT .triggered .connect (self .comment_toggle )
@@ -437,8 +439,12 @@ def workbox_for_name(cls, name, show=False, visible=False):
437439
438440 return workbox
439441
442+ def run_first_workbox (self ):
443+ workbox = self .uiWorkboxTAB .widget (0 ).widget (0 )
444+ self .run_workbox ("" , workbox = workbox )
445+
440446 @classmethod
441- def run_workbox (cls , name ):
447+ def run_workbox (cls , name , workbox = None ):
442448 """This is a function which will be added to __main__, and therefore
443449 available to PythonLogger users. It will accept a string matching the
444450 "{group}/{workbox}" format, or a boolean that will run the current tab
@@ -456,7 +462,8 @@ def run_workbox(cls, name):
456462 run_workbox('some/stuff.py')
457463 (from command line): blurdev launch Python_Logger --run_workbox
458464 """
459- workbox = cls .workbox_for_name (name )
465+ if workbox is None :
466+ workbox = cls .workbox_for_name (name )
460467
461468 if workbox is not None :
462469 # if name is True, its ok to run the workbox, this option
0 commit comments