@@ -218,6 +218,8 @@ def __init__(self, parent, name=None, run_workbox=False, standalone=False):
218
218
self .uiGroup8ACT .triggered .connect (partial (self .gotoGroupByIndex , 8 ))
219
219
self .uiGroupLastACT .triggered .connect (partial (self .gotoGroupByIndex , - 1 ))
220
220
221
+ self .uiRunFirstWorkboxACT .triggered .connect (self .run_first_workbox )
222
+
221
223
self .uiFocusNameACT .triggered .connect (self .show_focus_name )
222
224
223
225
self .uiCommentToggleACT .triggered .connect (self .comment_toggle )
@@ -437,8 +439,13 @@ def workbox_for_name(cls, name, show=False, visible=False):
437
439
438
440
return workbox
439
441
442
+ def run_first_workbox (self ):
443
+ print ("# Run first Workbox" )
444
+ workbox = self .uiWorkboxTAB .widget (0 ).widget (0 )
445
+ self .run_workbox ("" , workbox = workbox )
446
+
440
447
@classmethod
441
- def run_workbox (cls , name ):
448
+ def run_workbox (cls , name , workbox = None ):
442
449
"""This is a function which will be added to __main__, and therefore
443
450
available to PythonLogger users. It will accept a string matching the
444
451
"{group}/{workbox}" format, or a boolean that will run the current tab
@@ -456,7 +463,8 @@ def run_workbox(cls, name):
456
463
run_workbox('some/stuff.py')
457
464
(from command line): blurdev launch Python_Logger --run_workbox
458
465
"""
459
- workbox = cls .workbox_for_name (name )
466
+ if workbox is None :
467
+ workbox = cls .workbox_for_name (name )
460
468
461
469
if workbox is not None :
462
470
# if name is True, its ok to run the workbox, this option
0 commit comments