OpenOrchestrator 1.0.2__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- OpenOrchestrator/__init__.py +7 -0
- OpenOrchestrator/__main__.py +2 -0
- OpenOrchestrator/common/connection_frame.py +35 -49
- OpenOrchestrator/common/crypto_util.py +4 -4
- OpenOrchestrator/common/datetime_util.py +20 -0
- OpenOrchestrator/database/constants.py +25 -19
- OpenOrchestrator/database/db_util.py +77 -30
- OpenOrchestrator/database/logs.py +13 -0
- OpenOrchestrator/database/queues.py +17 -0
- OpenOrchestrator/database/triggers.py +25 -56
- OpenOrchestrator/orchestrator/application.py +87 -34
- OpenOrchestrator/orchestrator/datetime_input.py +75 -0
- OpenOrchestrator/orchestrator/popups/constant_popup.py +87 -69
- OpenOrchestrator/orchestrator/popups/credential_popup.py +92 -82
- OpenOrchestrator/orchestrator/popups/generic_popups.py +27 -0
- OpenOrchestrator/orchestrator/popups/trigger_popup.py +216 -0
- OpenOrchestrator/orchestrator/tabs/constants_tab.py +52 -0
- OpenOrchestrator/orchestrator/tabs/logging_tab.py +70 -0
- OpenOrchestrator/orchestrator/tabs/queue_tab.py +116 -0
- OpenOrchestrator/orchestrator/tabs/settings_tab.py +22 -0
- OpenOrchestrator/orchestrator/tabs/trigger_tab.py +87 -0
- OpenOrchestrator/scheduler/application.py +3 -3
- OpenOrchestrator/scheduler/connection_frame.py +96 -0
- OpenOrchestrator/scheduler/run_tab.py +87 -80
- OpenOrchestrator/scheduler/runner.py +33 -25
- OpenOrchestrator/scheduler/settings_tab.py +2 -1
- {OpenOrchestrator-1.0.2.dist-info → OpenOrchestrator-1.2.0.dist-info}/METADATA +2 -2
- OpenOrchestrator-1.2.0.dist-info/RECORD +38 -0
- OpenOrchestrator/orchestrator/constants_tab.py +0 -169
- OpenOrchestrator/orchestrator/logging_tab.py +0 -221
- OpenOrchestrator/orchestrator/popups/queue_trigger_popup.py +0 -129
- OpenOrchestrator/orchestrator/popups/scheduled_trigger_popup.py +0 -129
- OpenOrchestrator/orchestrator/popups/single_trigger_popup.py +0 -134
- OpenOrchestrator/orchestrator/settings_tab.py +0 -31
- OpenOrchestrator/orchestrator/table_util.py +0 -76
- OpenOrchestrator/orchestrator/trigger_tab.py +0 -231
- OpenOrchestrator-1.0.2.dist-info/RECORD +0 -36
- {OpenOrchestrator-1.0.2.dist-info → OpenOrchestrator-1.2.0.dist-info}/LICENSE +0 -0
- {OpenOrchestrator-1.0.2.dist-info → OpenOrchestrator-1.2.0.dist-info}/WHEEL +0 -0
- {OpenOrchestrator-1.0.2.dist-info → OpenOrchestrator-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"""This module is responsible for the layout and functionality of the 'New single Trigger' popup."""
|
|
2
|
-
|
|
3
|
-
# Disable pylint duplicate code error since it
|
|
4
|
-
# mostly reacts to the layout code being similar.
|
|
5
|
-
# pylint: disable=duplicate-code
|
|
6
|
-
|
|
7
|
-
from datetime import datetime
|
|
8
|
-
import tkinter
|
|
9
|
-
from tkinter import ttk, messagebox
|
|
10
|
-
import tkcalendar
|
|
11
|
-
|
|
12
|
-
from OpenOrchestrator.database import db_util
|
|
13
|
-
from OpenOrchestrator.database.triggers import SingleTrigger
|
|
14
|
-
|
|
15
|
-
# pylint: disable-next=too-many-instance-attributes
|
|
16
|
-
class SingleTriggerPopup(tkinter.Toplevel):
|
|
17
|
-
"""A popup for creating/updating single triggers."""
|
|
18
|
-
def __init__(self, trigger: SingleTrigger):
|
|
19
|
-
"""Create a new popup.
|
|
20
|
-
If a trigger is given it will be updated instead of creating a new trigger.
|
|
21
|
-
|
|
22
|
-
Args:
|
|
23
|
-
trigger: The Single Trigger to update if any.
|
|
24
|
-
"""
|
|
25
|
-
self.trigger = trigger
|
|
26
|
-
title = 'Update Single Trigger' if trigger else 'New Single Trigger'
|
|
27
|
-
|
|
28
|
-
super().__init__()
|
|
29
|
-
self.grab_set()
|
|
30
|
-
self.title(title)
|
|
31
|
-
self.geometry("300x350")
|
|
32
|
-
|
|
33
|
-
ttk.Label(self, text="Trigger Name:").pack()
|
|
34
|
-
self.trigger_entry = ttk.Entry(self)
|
|
35
|
-
self.trigger_entry.pack()
|
|
36
|
-
|
|
37
|
-
ttk.Label(self, text="Process Name:").pack()
|
|
38
|
-
self.name_entry = ttk.Entry(self)
|
|
39
|
-
self.name_entry.pack()
|
|
40
|
-
|
|
41
|
-
ttk.Label(self, text="Trigger Date:").pack()
|
|
42
|
-
self.date_entry = tkcalendar.DateEntry(self, date_pattern='dd/MM/yyyy')
|
|
43
|
-
self.date_entry.pack()
|
|
44
|
-
|
|
45
|
-
ttk.Label(self, text="Trigger Time:").pack()
|
|
46
|
-
self.time_entry = ttk.Entry(self)
|
|
47
|
-
if trigger is None:
|
|
48
|
-
self.time_entry.insert(0, 'hh:mm')
|
|
49
|
-
self.time_entry.pack()
|
|
50
|
-
|
|
51
|
-
ttk.Label(self, text="Process Path:").pack()
|
|
52
|
-
self.path_entry = ttk.Entry(self)
|
|
53
|
-
self.path_entry.pack()
|
|
54
|
-
|
|
55
|
-
ttk.Label(self, text="Arguments:").pack()
|
|
56
|
-
self.args_entry = ttk.Entry(self)
|
|
57
|
-
self.args_entry.pack()
|
|
58
|
-
|
|
59
|
-
self.git_check = tkinter.IntVar()
|
|
60
|
-
ttk.Checkbutton(self, text="Is Git Repo?", variable=self.git_check).pack()
|
|
61
|
-
|
|
62
|
-
self.blocking_check = tkinter.IntVar()
|
|
63
|
-
ttk.Checkbutton(self, text="Is Blocking?", variable=self.blocking_check).pack()
|
|
64
|
-
|
|
65
|
-
button_text = 'Update' if trigger else 'Create'
|
|
66
|
-
ttk.Button(self, text=button_text, command=self.create_trigger).pack()
|
|
67
|
-
ttk.Button(self, text='Cancel', command=self.destroy).pack()
|
|
68
|
-
|
|
69
|
-
if trigger is not None:
|
|
70
|
-
self.pre_populate()
|
|
71
|
-
|
|
72
|
-
def pre_populate(self):
|
|
73
|
-
"""Populate the form with values from an existing trigger"""
|
|
74
|
-
self.trigger_entry.insert(0, self.trigger.trigger_name)
|
|
75
|
-
self.name_entry.insert(0, self.trigger.process_name)
|
|
76
|
-
self.date_entry.set_date(self.trigger.next_run)
|
|
77
|
-
time_str = self.trigger.next_run.strftime("%H:%M")
|
|
78
|
-
self.time_entry.insert(0, time_str)
|
|
79
|
-
self.path_entry.insert(0, self.trigger.process_path)
|
|
80
|
-
self.args_entry.insert(0, self.trigger.process_args)
|
|
81
|
-
self.git_check.set(self.trigger.is_git_repo)
|
|
82
|
-
self.blocking_check.set(self.trigger.is_blocking)
|
|
83
|
-
|
|
84
|
-
def create_trigger(self):
|
|
85
|
-
"""Creates a new single trigger in the database using the data entered in the UI.
|
|
86
|
-
If an existing trigger was given when creating the popup it is updated instead.
|
|
87
|
-
"""
|
|
88
|
-
trigger_name = self.trigger_entry.get()
|
|
89
|
-
process_name = self.name_entry.get()
|
|
90
|
-
date = self.date_entry.get_date()
|
|
91
|
-
time = self.time_entry.get()
|
|
92
|
-
path = self.path_entry.get()
|
|
93
|
-
args = self.args_entry.get()
|
|
94
|
-
is_git = self.git_check.get()
|
|
95
|
-
is_blocking = self.blocking_check.get()
|
|
96
|
-
|
|
97
|
-
if not trigger_name:
|
|
98
|
-
messagebox.showerror('Error', 'Please enter a trigger name')
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
if not process_name:
|
|
102
|
-
messagebox.showerror('Error', 'Please enter a process name')
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
try:
|
|
106
|
-
hour, minute = time.split(":")
|
|
107
|
-
hour, minute = int(hour), int(minute)
|
|
108
|
-
next_run = datetime(date.year, date.month, date.day, hour, minute)
|
|
109
|
-
except ValueError as exc:
|
|
110
|
-
messagebox.showerror('Error', "Please enter a valid time in the format 'hh:mm'\n"+str(exc))
|
|
111
|
-
|
|
112
|
-
if next_run < datetime.now():
|
|
113
|
-
if not messagebox.askyesno('Warning', "The selected datetime is in the past. Do you want to create the trigger anyway?"):
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
if not path:
|
|
117
|
-
messagebox.showerror('Error', 'Please enter a process path')
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
if self.trigger is None:
|
|
121
|
-
# Create new trigger in database
|
|
122
|
-
db_util.create_single_trigger(trigger_name, process_name, next_run, path, args, is_git, is_blocking)
|
|
123
|
-
else:
|
|
124
|
-
# Update existing trigger
|
|
125
|
-
self.trigger.trigger_name = trigger_name
|
|
126
|
-
self.trigger.process_name = process_name
|
|
127
|
-
self.trigger.next_run = next_run
|
|
128
|
-
self.trigger.process_path = path
|
|
129
|
-
self.trigger.process_args = args
|
|
130
|
-
self.trigger.is_git_repo = is_git
|
|
131
|
-
self.trigger.is_blocking = is_blocking
|
|
132
|
-
db_util.update_trigger(self.trigger)
|
|
133
|
-
|
|
134
|
-
self.destroy()
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"""This module is responsible for the layout and functionality of the Settings tab
|
|
2
|
-
in Orchestrator."""
|
|
3
|
-
|
|
4
|
-
from tkinter import ttk
|
|
5
|
-
|
|
6
|
-
from OpenOrchestrator.database import db_util
|
|
7
|
-
from OpenOrchestrator.common.connection_frame import ConnectionFrame
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def create_tab(parent):
|
|
11
|
-
"""Create a new Setting tab object.
|
|
12
|
-
|
|
13
|
-
Args:
|
|
14
|
-
parent: The ttk.Notebook object that this tab is a child of.
|
|
15
|
-
|
|
16
|
-
Returns:
|
|
17
|
-
ttk.Frame: The created tab object as a ttk.Frame.
|
|
18
|
-
"""
|
|
19
|
-
tab = ttk.Frame(parent)
|
|
20
|
-
tab.pack(fill='both', expand=True)
|
|
21
|
-
|
|
22
|
-
conn_frame = ConnectionFrame(tab)
|
|
23
|
-
conn_frame.pack(fill='x')
|
|
24
|
-
|
|
25
|
-
key_button = ttk.Button(tab, text="New key", command=conn_frame.new_key)
|
|
26
|
-
key_button.pack()
|
|
27
|
-
|
|
28
|
-
init_button = ttk.Button(tab, text='Initialize Database', command=db_util.initialize_database)
|
|
29
|
-
init_button.pack()
|
|
30
|
-
|
|
31
|
-
return tab
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"""This module contains convenience functions related to ttk.Treeview objects."""
|
|
2
|
-
|
|
3
|
-
from tkinter import ttk
|
|
4
|
-
import os
|
|
5
|
-
|
|
6
|
-
def create_table(parent: ttk.Frame, columns: list[str]):
|
|
7
|
-
"""Create a ttk.Treeview with horizontal and vertical scroll bars
|
|
8
|
-
and with the given column names.
|
|
9
|
-
Bind ctrl+c to copy selection to the clipboard.
|
|
10
|
-
|
|
11
|
-
Args:
|
|
12
|
-
parent: The parent frame of the table and scroll bars.
|
|
13
|
-
columns: A list of column names.
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
ttk.Treeview: The created table (treeview).
|
|
17
|
-
"""
|
|
18
|
-
table = ttk.Treeview(parent, show='headings', selectmode='browse')
|
|
19
|
-
table['columns'] = columns
|
|
20
|
-
for column in table['columns']:
|
|
21
|
-
table.heading(column, text=column, anchor='w')
|
|
22
|
-
table.column(column, stretch=False)
|
|
23
|
-
|
|
24
|
-
yscroll = ttk.Scrollbar(parent, orient='vertical', command=table.yview)
|
|
25
|
-
yscroll.pack(side='right', fill='y')
|
|
26
|
-
table.configure(yscrollcommand=yscroll.set)
|
|
27
|
-
|
|
28
|
-
xscroll = ttk.Scrollbar(parent, orient='horizontal', command=table.xview)
|
|
29
|
-
xscroll.pack(side='bottom', fill='x')
|
|
30
|
-
table.configure(xscrollcommand=xscroll.set)
|
|
31
|
-
|
|
32
|
-
table.pack(expand=True, fill='both')
|
|
33
|
-
|
|
34
|
-
table.bind("<Control-c>", lambda e: copy_selected_rows_to_clipboard(table))
|
|
35
|
-
|
|
36
|
-
return table
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def copy_selected_rows_to_clipboard(table: ttk.Treeview) -> None:
|
|
40
|
-
"""Copies the values of the selected rows in the table to the clipboard.
|
|
41
|
-
|
|
42
|
-
Args:
|
|
43
|
-
table: The table to copy from.
|
|
44
|
-
"""
|
|
45
|
-
if len(table.selection()) == 0:
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
items = []
|
|
49
|
-
for row_id in table.selection():
|
|
50
|
-
values = table.item(row_id, "values")
|
|
51
|
-
items.append(f'echo "{values}"')
|
|
52
|
-
string = '('+' & '.join(items)+')'
|
|
53
|
-
os.system(f"{string} | clip")
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def update_table(table: ttk.Treeview, rows: list[list[any]]) -> None:
|
|
57
|
-
"""Deletes all rows in the table and inserts the given values.
|
|
58
|
-
|
|
59
|
-
Args:
|
|
60
|
-
table: The table whose values to replace.
|
|
61
|
-
rows: The new row values to insert.
|
|
62
|
-
"""
|
|
63
|
-
#Clear table
|
|
64
|
-
for row in table.get_children():
|
|
65
|
-
table.delete(row)
|
|
66
|
-
|
|
67
|
-
#Update table
|
|
68
|
-
for row in rows:
|
|
69
|
-
row = [str(d) for d in row]
|
|
70
|
-
table.insert('', 'end', values=row)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def deselect_tables(*tables) -> None:
|
|
74
|
-
"""Deselects all selected rows in the given tables."""
|
|
75
|
-
for table in tables:
|
|
76
|
-
table.selection_remove(table.selection())
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
"""This module is responsible for the layout and functionality of the Trigger tab
|
|
2
|
-
in Orchestrator."""
|
|
3
|
-
|
|
4
|
-
from tkinter import ttk, messagebox
|
|
5
|
-
|
|
6
|
-
from OpenOrchestrator.database import db_util
|
|
7
|
-
from OpenOrchestrator.database.triggers import Trigger, TriggerStatus, ScheduledTrigger, SingleTrigger, QueueTrigger
|
|
8
|
-
from OpenOrchestrator.orchestrator import table_util
|
|
9
|
-
from OpenOrchestrator.orchestrator.popups.scheduled_trigger_popup import ScheduledTriggerPopup
|
|
10
|
-
from OpenOrchestrator.orchestrator.popups.single_trigger_popup import SingleTriggerPopup
|
|
11
|
-
from OpenOrchestrator.orchestrator.popups.queue_trigger_popup import QueueTriggerPopup
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def create_tab(parent: ttk.Notebook) -> ttk.Frame:
|
|
15
|
-
"""Create a new Trigger tab object.
|
|
16
|
-
|
|
17
|
-
Args:
|
|
18
|
-
parent: The ttk.Notebook object that this tab is a child of.
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
ttk.Frame: The created tab object as a ttk.Frame.
|
|
22
|
-
"""
|
|
23
|
-
tab = ttk.Frame(parent)
|
|
24
|
-
tab.pack(fill='both', expand=True)
|
|
25
|
-
tab.columnconfigure(0, weight=1)
|
|
26
|
-
tab.rowconfigure((0,2,4), weight=1, uniform='a')
|
|
27
|
-
tab.rowconfigure((1,3,5), weight=6, uniform='a')
|
|
28
|
-
tab.rowconfigure((6,7), weight=1, uniform='a')
|
|
29
|
-
|
|
30
|
-
#Scheduled table
|
|
31
|
-
ttk.Label(tab, text="Scheduled Triggers").grid(row=0, column=0)
|
|
32
|
-
sc_table_frame = ttk.Frame(tab)
|
|
33
|
-
sc_table_frame.grid(row=1, column=0, sticky='nsew')
|
|
34
|
-
sc_table = table_util.create_table(sc_table_frame, ('Trigger Name', 'Status', 'Process Name', 'Cron', 'Last run', 'Next run', 'Path', 'Arguments', 'Is GIT?', 'Blocking?', 'UUID'))
|
|
35
|
-
|
|
36
|
-
#Queue table
|
|
37
|
-
ttk.Label(tab, text="Queue Triggers").grid(row=2, column=0)
|
|
38
|
-
q_table_frame = ttk.Frame(tab)
|
|
39
|
-
q_table_frame.grid(row=3, column=0, sticky='nsew')
|
|
40
|
-
q_table = table_util.create_table(q_table_frame, ('Trigger Name', 'Status', 'Process Name', 'Queue Name', 'Min batch size', 'Last run', 'Path', 'Arguments', 'Is GIT?', 'Blocking?', 'UUID'))
|
|
41
|
-
|
|
42
|
-
#Single table
|
|
43
|
-
ttk.Label(tab, text="Single Triggers").grid(row=4, column=0)
|
|
44
|
-
si_table_frame = ttk.Frame(tab)
|
|
45
|
-
si_table_frame.grid(row=5, column=0, sticky='nsew')
|
|
46
|
-
si_table = table_util.create_table(si_table_frame, ('Trigger Name', 'Status', 'Process Name', 'Last run', 'Next run', 'Path', 'Arguments', 'Is GIT?', 'Blocking?', 'UUID'))
|
|
47
|
-
|
|
48
|
-
# Controls 1
|
|
49
|
-
controls_frame = ttk.Frame(tab)
|
|
50
|
-
controls_frame.grid(row=6, column=0)
|
|
51
|
-
|
|
52
|
-
def update_command():
|
|
53
|
-
update_tables(sc_table, q_table, si_table)
|
|
54
|
-
|
|
55
|
-
update_button = ttk.Button(controls_frame, text='Update tables', command=update_command)
|
|
56
|
-
update_button.pack(side='left')
|
|
57
|
-
|
|
58
|
-
enable_button = ttk.Button(controls_frame, text="Enable", command=lambda: set_trigger_status(TriggerStatus.IDLE, sc_table, q_table, si_table))
|
|
59
|
-
enable_button.pack(side='left')
|
|
60
|
-
|
|
61
|
-
disable_button = ttk.Button(controls_frame, text="Disable", command=lambda: set_trigger_status(TriggerStatus.PAUSED, sc_table, q_table, si_table))
|
|
62
|
-
disable_button.pack(side='left')
|
|
63
|
-
|
|
64
|
-
delete_button = ttk.Button(controls_frame, text='Delete', command=lambda: delete_trigger(sc_table, q_table, si_table))
|
|
65
|
-
delete_button.pack(side='left')
|
|
66
|
-
|
|
67
|
-
# Controls 2
|
|
68
|
-
controls_frame2 = ttk.Frame(tab)
|
|
69
|
-
controls_frame2.grid(row=7, column=0)
|
|
70
|
-
|
|
71
|
-
ttk.Button(controls_frame2, text='New scheduled trigger', command=lambda: show_scheduled_trigger_popup(update_command)).pack(side='left')
|
|
72
|
-
ttk.Button(controls_frame2, text='New queue trigger', command=lambda: show_queue_trigger_popup(update_command)).pack(side='left')
|
|
73
|
-
ttk.Button(controls_frame2, text='New single trigger', command=lambda: show_single_trigger_popup(update_command)).pack(side='left')
|
|
74
|
-
|
|
75
|
-
# Bindings
|
|
76
|
-
sc_table.bind('<FocusIn>', lambda e: table_util.deselect_tables(q_table, si_table))
|
|
77
|
-
sc_table.bind('<Double-1>', lambda e: double_click_trigger_tables(sc_table, q_table, si_table))
|
|
78
|
-
|
|
79
|
-
q_table.bind('<FocusIn>', lambda e: table_util.deselect_tables(sc_table, si_table))
|
|
80
|
-
q_table.bind('<Double-1>', lambda e: double_click_trigger_tables(sc_table, q_table, si_table))
|
|
81
|
-
|
|
82
|
-
si_table.bind('<FocusIn>', lambda e: table_util.deselect_tables(sc_table, q_table))
|
|
83
|
-
si_table.bind('<Double-1>', lambda e: double_click_trigger_tables(sc_table, q_table, si_table))
|
|
84
|
-
|
|
85
|
-
return tab
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
def show_scheduled_trigger_popup(on_close: callable, trigger: ScheduledTrigger = None) -> None:
|
|
89
|
-
"""Shows the new scheduled trigger popup.
|
|
90
|
-
Binds a callable to the popup's on_close event.
|
|
91
|
-
|
|
92
|
-
Args:
|
|
93
|
-
on_close: on_close: A function to be called when the popup closes.
|
|
94
|
-
trigger: The trigger to edit if any.
|
|
95
|
-
"""
|
|
96
|
-
popup = ScheduledTriggerPopup(trigger)
|
|
97
|
-
popup.bind('<Destroy>', lambda e: on_close() if e.widget == popup else ...)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def show_single_trigger_popup(on_close: callable, trigger: SingleTrigger = None) -> None:
|
|
101
|
-
"""Shows the new single trigger popup.
|
|
102
|
-
Binds a callable to the popup's on_close event.
|
|
103
|
-
|
|
104
|
-
Args:
|
|
105
|
-
on_close: on_close: A function to be called when the popup closes.
|
|
106
|
-
"""
|
|
107
|
-
popup = SingleTriggerPopup(trigger)
|
|
108
|
-
popup.bind('<Destroy>', lambda e: on_close() if e.widget == popup else ...)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
def show_queue_trigger_popup(on_close: callable, trigger: QueueTrigger = None) -> None:
|
|
112
|
-
"""Shows the new queue trigger popup.
|
|
113
|
-
Binds a callable to the popup's on_close event.
|
|
114
|
-
|
|
115
|
-
Args:
|
|
116
|
-
on_close: on_close: A function to be called when the popup closes.
|
|
117
|
-
"""
|
|
118
|
-
popup = QueueTriggerPopup(trigger)
|
|
119
|
-
popup.bind('<Destroy>', lambda e: on_close() if e.widget == popup else ...)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def update_tables(sc_table: ttk.Treeview, q_table: ttk.Treeview, si_table: ttk.Treeview):
|
|
123
|
-
"""Updates all three trigger tables
|
|
124
|
-
with values from the database.
|
|
125
|
-
|
|
126
|
-
Args:
|
|
127
|
-
sc_table: The scheduled table.
|
|
128
|
-
q_table: The queue table.
|
|
129
|
-
si_table: The single table.
|
|
130
|
-
"""
|
|
131
|
-
scheduled_triggers = db_util.get_scheduled_triggers()
|
|
132
|
-
sc_list = [t.to_tuple() for t in scheduled_triggers]
|
|
133
|
-
|
|
134
|
-
queue_triggers = db_util.get_queue_triggers()
|
|
135
|
-
q_list = [t.to_tuple() for t in queue_triggers]
|
|
136
|
-
|
|
137
|
-
single_triggers = db_util.get_single_triggers()
|
|
138
|
-
si_list = [t.to_tuple() for t in single_triggers]
|
|
139
|
-
|
|
140
|
-
table_util.update_table(sc_table, sc_list)
|
|
141
|
-
table_util.update_table(q_table, q_list)
|
|
142
|
-
table_util.update_table(si_table, si_list)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
def delete_trigger(sc_table: ttk.Treeview, q_table: ttk.Treeview, si_table: ttk.Treeview) -> None:
|
|
146
|
-
"""Deletes the currently selected trigger from either
|
|
147
|
-
of the three trigger tables.
|
|
148
|
-
Shows a confirmation dialog before deleting.
|
|
149
|
-
|
|
150
|
-
Args:
|
|
151
|
-
sc_table: The scheduled table.
|
|
152
|
-
q_table: The queue table.
|
|
153
|
-
si_table: The single table.
|
|
154
|
-
"""
|
|
155
|
-
trigger = get_selected_trigger(sc_table, q_table, si_table)
|
|
156
|
-
|
|
157
|
-
if trigger is None:
|
|
158
|
-
messagebox.showinfo("No trigger selected", "No trigger is selected.")
|
|
159
|
-
return
|
|
160
|
-
|
|
161
|
-
if not messagebox.askyesno('Delete trigger', f"Are you sure you want to delete trigger '{trigger.trigger_name} - {trigger.id}'?"):
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
db_util.delete_trigger(trigger.id)
|
|
165
|
-
|
|
166
|
-
update_tables(sc_table, q_table, si_table)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
def set_trigger_status(status: TriggerStatus, sc_table: ttk.Treeview, q_table: ttk.Treeview, si_table: ttk.Treeview) -> None:
|
|
170
|
-
"""Set the status of the currently selected trigger.
|
|
171
|
-
|
|
172
|
-
Args:
|
|
173
|
-
status: The new status to apply.
|
|
174
|
-
sc_table: The scheduled table.
|
|
175
|
-
q_table: The queue table.
|
|
176
|
-
si_table: The single table.
|
|
177
|
-
"""
|
|
178
|
-
trigger = get_selected_trigger(sc_table, q_table, si_table)
|
|
179
|
-
|
|
180
|
-
if trigger is None:
|
|
181
|
-
messagebox.showinfo("No trigger selected", "No trigger is selected.")
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
db_util.set_trigger_status(trigger.id, status)
|
|
185
|
-
|
|
186
|
-
update_tables(sc_table, q_table, si_table)
|
|
187
|
-
|
|
188
|
-
messagebox.showinfo("Trigger status changed", f"The status of '{trigger.trigger_name}' has been set to {status.value}")
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
def get_selected_trigger(sc_table: ttk.Treeview, q_table: ttk.Treeview, si_table: ttk.Treeview) -> Trigger:
|
|
192
|
-
"""Get the currently selected trigger across all three tables.
|
|
193
|
-
|
|
194
|
-
Args:
|
|
195
|
-
sc_table: The scheduled table.
|
|
196
|
-
q_table: The queue table.
|
|
197
|
-
si_table: The single table.
|
|
198
|
-
|
|
199
|
-
Returns:
|
|
200
|
-
Trigger: The ORM trigger object with the given id.
|
|
201
|
-
"""
|
|
202
|
-
if sc_table.selection():
|
|
203
|
-
table = sc_table
|
|
204
|
-
elif q_table.selection():
|
|
205
|
-
table = q_table
|
|
206
|
-
elif si_table.selection():
|
|
207
|
-
table = si_table
|
|
208
|
-
else:
|
|
209
|
-
return None
|
|
210
|
-
|
|
211
|
-
trigger_id = table.item(table.selection()[0])['values'][-1]
|
|
212
|
-
return db_util.get_trigger(trigger_id)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
def double_click_trigger_tables(sc_table, q_table, si_table):
|
|
216
|
-
"""This triggers when one of the trigger tables are double clicked.
|
|
217
|
-
Opens the corresponding dialog to edit a trigger.
|
|
218
|
-
|
|
219
|
-
Args:
|
|
220
|
-
sc_table: The scheduled table.
|
|
221
|
-
q_table: The queue table.
|
|
222
|
-
si_table: The single table.
|
|
223
|
-
"""
|
|
224
|
-
trigger = get_selected_trigger(sc_table, q_table, si_table)
|
|
225
|
-
|
|
226
|
-
if isinstance(trigger, ScheduledTrigger):
|
|
227
|
-
show_scheduled_trigger_popup(lambda: update_tables(sc_table, q_table, si_table), trigger=trigger)
|
|
228
|
-
elif isinstance(trigger, SingleTrigger):
|
|
229
|
-
show_single_trigger_popup(lambda: update_tables(sc_table, q_table, si_table), trigger=trigger)
|
|
230
|
-
elif isinstance(trigger, QueueTrigger):
|
|
231
|
-
show_queue_trigger_popup(lambda: update_tables(sc_table, q_table, si_table), trigger=trigger)
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
OpenOrchestrator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
OpenOrchestrator/__main__.py,sha256=1Kxi12d-Z8E0ZLpaDWb_Ajvb-GRId38LmeEblyUS7q0,516
|
|
3
|
-
OpenOrchestrator/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
OpenOrchestrator/common/connection_frame.py,sha256=kUvlSyNDlzaqUnJSMo8gfaZrdR_wm5qGGLmgPkxWl0k,3368
|
|
5
|
-
OpenOrchestrator/common/crypto_util.py,sha256=YjdLtGS_Ui88XqNzUJ6CdEFwY9lcxqIYKZ3izz5O-vM,2123
|
|
6
|
-
OpenOrchestrator/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
OpenOrchestrator/database/constants.py,sha256=7JW50xYcAkdgrycxAkQUSwFrjThq7gKuh7JTj4u16fQ,1924
|
|
8
|
-
OpenOrchestrator/database/db_util.py,sha256=RISbmp_o8DHFIQXqB0IGhDTRZF6AqzpIRW2BFuIEYSE,26388
|
|
9
|
-
OpenOrchestrator/database/logs.py,sha256=cXibLsRAkKVfXdT2_D4hGI4ns_O7OIwZ5G7I8RWAVQc,1196
|
|
10
|
-
OpenOrchestrator/database/queues.py,sha256=CWHLZhFEdNEiwWrbKbkGFgroHQpyT1kZQ4ixNskAVAw,1647
|
|
11
|
-
OpenOrchestrator/database/triggers.py,sha256=QJ-4U9iAqh0s8Jiky0wuW3SI2SvX79ZuahSMDM1L3vw,4545
|
|
12
|
-
OpenOrchestrator/orchestrator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
OpenOrchestrator/orchestrator/application.py,sha256=swGP18FyIwWSbmDmzdoDXuSkizBabF-5ZNDPmXMY1wM,1321
|
|
14
|
-
OpenOrchestrator/orchestrator/constants_tab.py,sha256=ruK0Dh-Lfz3mpC2h7Nk42tlblxrhZRNsmXqwLC5ESm4,6757
|
|
15
|
-
OpenOrchestrator/orchestrator/logging_tab.py,sha256=g3x4jKx-WARwl1rEy9MUDH_2HyUcI4O4o-kxjYFtM4c,7277
|
|
16
|
-
OpenOrchestrator/orchestrator/settings_tab.py,sha256=tkBh83tR51zgEHtoeAsXh9Gv1895Z43bwOEGig9nCAo,845
|
|
17
|
-
OpenOrchestrator/orchestrator/table_util.py,sha256=9DEue8xGxEiAM9VGxVKGidQeWChuvWXGID05VguqtfY,2333
|
|
18
|
-
OpenOrchestrator/orchestrator/trigger_tab.py,sha256=yoUZVvA92zM8me49mh1iRlq_h7VjvdDicefogaLbTB0,9244
|
|
19
|
-
OpenOrchestrator/orchestrator/popups/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
OpenOrchestrator/orchestrator/popups/constant_popup.py,sha256=NUcKtIEPvhwVz_gOiLq74s5y5OqsPJ2nXGLclysyKKg,2112
|
|
21
|
-
OpenOrchestrator/orchestrator/popups/credential_popup.py,sha256=9R_Ua6A-oKPwMk09y-L9K3DgQSXlsz-Uhm-atdPcnPw,2641
|
|
22
|
-
OpenOrchestrator/orchestrator/popups/queue_trigger_popup.py,sha256=7dC_JuslsVgnVKVo-GEaRxrUwCMWyRnXDCeSO3DIkhg,4855
|
|
23
|
-
OpenOrchestrator/orchestrator/popups/scheduled_trigger_popup.py,sha256=0gVxuRDbNkVDE1bPoCfKfxog4WeUQjfAoDNLzA0yymo,4901
|
|
24
|
-
OpenOrchestrator/orchestrator/popups/single_trigger_popup.py,sha256=RswG7Xww2WnmZ7IHW6cwsGDhtnI8HaSn-wwm2gOjpi4,5172
|
|
25
|
-
OpenOrchestrator/orchestrator_connection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
-
OpenOrchestrator/orchestrator_connection/connection.py,sha256=DU552EigOu2xzM3SjY4766BXrDEnDC2jC4Jjy0-9OrU,8706
|
|
27
|
-
OpenOrchestrator/scheduler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
OpenOrchestrator/scheduler/application.py,sha256=HJd-b6Ww6h2XZCMyrIjDAKAidimm_CBmjouIzMHe7gg,1622
|
|
29
|
-
OpenOrchestrator/scheduler/run_tab.py,sha256=VYwl4RwSDUHWrIgtNvKMzclJR-wWS_WBESOrqFAzpnE,5173
|
|
30
|
-
OpenOrchestrator/scheduler/runner.py,sha256=mW5sCplsZrTthwL7bsqjwQTLKt7-O3zggW0mW_i738A,7885
|
|
31
|
-
OpenOrchestrator/scheduler/settings_tab.py,sha256=OQU3Bc3iQj8Hu4M6-9o-gy_Hu0EVtu66SKGcvUdMBGU,609
|
|
32
|
-
OpenOrchestrator-1.0.2.dist-info/LICENSE,sha256=4-Kjm-gkbiOLCBYMzsVJZEepdsm2vk8QesNOASvi9mg,1068
|
|
33
|
-
OpenOrchestrator-1.0.2.dist-info/METADATA,sha256=XRwC1AwS8-cGaIlykvvRB1JpvLlpUOnlEaWRcjgMmyo,1940
|
|
34
|
-
OpenOrchestrator-1.0.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
35
|
-
OpenOrchestrator-1.0.2.dist-info/top_level.txt,sha256=2btKMQESHuRC_ICbCjHTHH_-us2G7CyeskeaSTTL07Y,17
|
|
36
|
-
OpenOrchestrator-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|