*.(i.SrSSKJrJrJrJrJrJrJrJ r J r J r SSK J r SSKJr SSKJr SSKJr SSKJr SSKJr "S S \5rg ) zB Groups Widget for Python Scheduler Display and manage job groups ) QWidget QVBoxLayout QHBoxLayout QTableWidgetQTableWidgetItem QPushButton QHeaderViewQLabel QMessageBoxQMenu)Qt)QAction)logger)SchedulerDatabase)SchedulerConfig)GroupEditorDialogcv^\rSrSrSrS\S\4U4SjjrSrSr Sr S \ 4S jr S r S rS rSrSrSrU=r$) GroupsWidgetzJob groups list widgetdbconfigcz>[TU]5 XlX lUR 5 UR 5 g)N)super__init__rr _setup_uirefresh)selfrr __class__s (c:\PYTHON\Scheduler\gui\groups_widget.pyrGroupsWidget.__init__s+    cT [U5n[5n[S5nURS5 UR U5 UR 5 [ S5UlURRRUR5 UR UR5 URU5 [5n[ S5Ul URRS5 URRRUR5 UR UR5 [ S5UlURRS5 URRRUR 5 UR UR5 [ S5UlUR"RS 5 UR"RS5 UR"RRUR$5 UR UR"5 [ S 5UlUR&RS 5 UR&RS5 UR&RRUR(5 UR UR&5 UR 5 URU5 [+5UlUR,R/S 5 UR,R1/S Q5 UR,R35R5S[6R8R:5 UR,R=[*R>R@5 UR,RCS5 UR,RE[*RFRH5 UR,RK[LRNRP5 UR,RRRURT5 UR,RVRURX5 UR UR,5 g)zSetup UIzJob Groups (Chains)z#font-size: 14px; font-weight: bold;Refreshz New Groupz;background-color: #4CAF50; color: white; padding: 5px 15px;EditF Run Groupz;background-color: #2196F3; color: white; padding: 5px 15px;Deletez;background-color: #f44336; color: white; padding: 5px 15px;)IDNamez Jobs CountzError HandlingCreatedTN)-rrr setStyleSheet addWidget addStretchr refresh_btnclickedconnectr addLayout new_group_btn _new_groupedit_group_btn setEnabled _edit_group run_group_btn _run_groupdelete_group_btn _delete_grouprtablesetColumnCountsetHorizontalHeaderLabelshorizontalHeadersetSectionResizeModer ResizeModeStretchsetSelectionBehaviorSelectionBehavior SelectRowssetAlternatingRowColorssetEditTriggers EditTriggerNoEditTriggerssetContextMenuPolicyr ContextMenuPolicyCustomContextMenucustomContextMenuRequested_show_context_menuitemSelectionChanged_on_selection_changed)rlayout header_layout header_labelactions_layouts rrGroupsWidget._setup_uisST"$ 34 ""#HI -  "'y1   ((6 0 01'%(5 (()fg ""**4??;  !3!34)&1 &&u- ##++D,<,<=  !4!45(5 (()fg %%e, ""**4??;  !3!34 +H 5 ++,ij ((/ %%--d.@.@A  !6!67!!#("^  !!!$ ,,.   ##%::1k>T>T>\>\] '' (F(F(Q(QR **40 ""<#;#;#J#JK ''(<(<(N(NO --55d6M6MN ''//0J0JK$r!c URR5nURS5nUR5Vs/sHn[ U5PM nnSSS5 UR R [W55 [U5GHGup5UR RUS[[US555 [US5nUR RUSU5 URRUS5n[[[U555nUR[RR 5 UR RUSU5 UR RUS[US 55 US (aUS SS OS n UR RUS [U 55 GMJ ["R$"S[U5S35 gs snf!,(df  GN=f![&a#n ["R("SU 35 Sn A gSn A ff=f)zRefresh groups listz&SELECT * FROM job_groups ORDER BY nameNridnamer+error_handling created_atrzN/AzRefreshed groups table: z groupszError refreshing groups: )r_get_connectionexecutefetchalldictr< setRowCountlen enumeratesetItemrstrget_job_group_memberssetTextAlignmentr AlignmentFlag AlignCenterrdebug Exceptionerror) rconncursorrowgroupsgroup name_itemmembers count_item created_stres rrGroupsWidget.refreshas :((*d&NO/5/@A/@$s)/@A+ JJ " "3v; /'/  ""3+;Cd HF&H>H H H IH==Ic[URR55S:nURR U5 UR R U5 UR R U5 g)zHandle selection changerN)rcr< selectedItemsr5r6r8r:)r has_selections rrP"GroupsWidget._on_selection_changedsZDJJ4467!;  &&}5 %%m4 ((7r!returncURR5R5nU(dgUSR5n[ URR US5R 55nU$)zGet selected group IDNr)r<selectionModel selectedRowsrpintitemtext)r selected_rowsrpgroup_ids r_get_selected_group_id#GroupsWidget._get_selected_group_ids] 113@@B A""$tzzsA.3356r!c[XRUR5nUR5(aUR 5 gg)zCreate new groupN)rrrexecr)rdialogs rr4GroupsWidget._new_groups/"4$++> ;;== LLN r!cUR5nU(dg[XRURUS9nUR 5(aUR 5 gg)zEdit selected groupN)r)rrrrrr)rrrs rr7GroupsWidget._edit_groupsE..0 "4$++Q ;;== LLN r!c 8UR5nU(dgURRU5nURRU5nU(d [R "USSUSS35 gUVs/sHoDSPM nnSR S[U555n[R"US S USS [U5S U3[RR[RR-5nU[RR:XGa-S SK Jn U"URUR5n USn /n UH|n U Sn U Sn[ R""SU SUSU35 U R%U SUS9nU(d7U R'U5 U S:Xa[R "USSUS35 OM|M~ U (a>[R "USSUSS[U 5S 3SR U 5-5 O+[R."US!SUSS"[U5S#35 UR15 ggs snf![(aen[ R*"SU SU35 U R'U5 U S:Xa&[R,"USSUSUS35 SnA MSnAGMqSnAff=f![(a>n[ R*"S$U35 [R,"US%S&U35 SnAgSnAff=f)'z%Execute group (run all jobs in order)NWarningGroup 'rXz' has no jobs to executejob_name c3:# UHupUS-SU3v M g7f)r+z. N).0irXs r *GroupsWidget._run_group..s# VAUgaAaC54&!1AUsr%zExecute group 'z' with z jobs? Execution order: r) JobExecutorr[job_idzExecuting job z (z ) in group manual_group) triggered_byr stop_on_errorzGroup Execution StoppedzJob 'zL' failed to start. Stopping group execution (error_handling: stop_on_error)zError executing job z: z' failed with error: z: Stopping group execution (error_handling: stop_on_error)z%Group Execution Completed with Errorsz' completed with z failed job(s): Successz' started successfully. All z% jobs have been queued for execution.zError running group: ErrorzFailed to run group: )rr get_job_grouprgr warningjoinrdquestionrcStandardButtonYesNodaemon.job_executorrrrinfo execute_jobappendrlrmcritical informationr)rrrrrtm job_namesjob_listreplyrexecutorr[ failed_jobsmemberrr execution_idrws rr9GroupsWidget._run_groups?..0 Q MGG))(3Egg33H=G##D)wuV}oMe5fg0781:I8yy V9AU VVH((!%-G ~Eabjakl**..1K1K1N1NN E 22666;&tww <"''7!8 %F#H-F%j1HKK.8*KPXz Z["'/';';")7%-(<( ,'..x8-@ + 3 3$($=&+H:6D%E!" !& A ,&H''?!%-0A#kBRASSdehlhqhqr}h~~  ++!!%-0OPST[P\~^CD  w79V% " ';F82aS%IJ#**84)_<'00 $ 9"'z1GsKG!H " = "8 M LL04 5  w2Gs0K L L Ms^AK7K;I C;KA IBKK K)AK ;K KK L4LLc ,UR5nU(dgURRU5nURRU5n[R "USSUSS[ U5S3[RR[RR-[RR5nU[RR:XadURRU5 [R"SU35 [R"USS USS 35 UR5 gg![a>n[R "S U35 [R""US S U35 SnAgSnAff=f)zDelete selected groupNzConfirm DeletezDelete group 'rXz''? This will remove the group and its z9 job member(s). (The jobs themselves will not be deleted)zDeleted group rrz' deleted successfullyzError deleting group: rzFailed to delete group: )rrrrgr rrcrrrdelete_job_grouprrrrrlrmr)rrrrrtrrws rr;GroupsWidget._delete_groups`..0  PGG))(3Egg33H=G ((  v/XY\]dYeXfgab**..1K1K1N1NN**-- E 22666((2 nXJ78''i75=/Qg9hi  7  P LL1!5 6  w2J1#0N O O PsD/E F4FFcUR5nU(dgURRU5n[U5n[ SU5nUR R UR5 URU5 [ SU5nUR R UR5 URU5 [ SU5nUR R UR5 URU5 URURR5RU55 g![a#n[ R""SU35 SnAgSnAff=f)zShow context menuNzEdit...r%r&zError showing context menu: )rrrr r triggeredr1r7 addActionr9r;rr<viewport mapToGlobalrlrrm) rpositionrrrmenu edit_action run_action delete_actionrws rrNGroupsWidget._show_context_menus..0  =GG))(3E;D")T2K  ! ! ) )$*:*: ; NN; '!d3J  ( ( 9 NN: &$Hd3M  # # + +D,>,> ? NN= ) IIdjj))+77A B = LL7s; < < =sD$D?? E, E''E,)rrr:r5r3r/r8r<)__name__ __module__ __qualname____firstlineno____doc__rrrrrrPrrr4r7r9r;rN__static_attributes__ __classcell__)rs@rrrsZ ,oA%F!:F8 WMrP:==r!rN)rPyQt6.QtWidgetsrrrrrrr r r r PyQt6.QtCorer PyQt6.QtGuirlogurur core.databaser core.configrgui.group_editor_dialogrrrr!rrs; +'5e=7e=r!