13 from __future__
import absolute_import
14 from __future__
import print_function
16 from project_modules.projectstatus
import ProjectStatus
17 from project_modules.batchstatus
import BatchStatus
25 import tkinter.messagebox
as tkinter_messagebox
26 import tkinter.font
as tkinter_font
29 import tkMessageBox
as tkinter_messagebox
30 import tkFont
as tkinter_font
60 tk.Frame.__init__(self, self.
parent)
61 self.pack(expand=1, fill=tk.BOTH)
62 self.rowconfigure(0, weight=1)
90 self.
stage_cat = tk.Label(self, bg=
'powderblue', relief=tk.RIDGE, text=
'',
91 padx=10, pady=10, font=tkinter_font.Font(size=12))
92 self.stage_cat.grid(row=0, column=0, sticky=tk.N+tk.E+tk.W+tk.S)
93 self.
files_cat = tk.Frame(self, bd=1, relief=tk.SUNKEN, bg=
'lightsteelblue')
94 files_label = tk.Label(self.
files_cat, bg=
'lightsteelblue', relief=tk.FLAT, text=
'Output',
95 padx=10, font=tkinter_font.Font(size=12))
96 files_label.pack(side=tk.LEFT, expand=1, fill=tk.BOTH)
97 fetchlog_button = tk.Button(self.
files_cat, bg=
'lightcyan', activebackground=
'aliceblue',
98 text=
'Fetchlog', command=self.parent.parent.fetchlog)
99 fetchlog_button.pack(side=tk.RIGHT)
100 checkana_button = tk.Button(self.
files_cat, bg=
'lightcyan', activebackground=
'aliceblue',
101 text=
'CheckAna', command=self.parent.parent.checkana)
102 checkana_button.pack(side=tk.RIGHT)
103 check_button = tk.Button(self.
files_cat, bg=
'lightcyan', activebackground=
'aliceblue',
104 text=
'Check', command=self.parent.parent.check)
105 check_button.pack(side=tk.RIGHT)
106 self.files_cat.grid(row=0, column=kEXISTS, columnspan=kIDLE-kEXISTS,
107 sticky=tk.N+tk.E+tk.W+tk.S)
108 self.
batch_cat = tk.Frame(self, bd=1, relief=tk.SUNKEN, bg=
'powderblue')
109 batch_label = tk.Label(self.
batch_cat, bg=
'powderblue', relief=tk.FLAT, text=
'Batch Jobs',
110 padx=10, font=tkinter_font.Font(size=12))
111 batch_label.pack(side=tk.LEFT, expand=1, fill=tk.BOTH)
112 batch_button = tk.Button(self.
batch_cat, bg=
'lightcyan', activebackground=
'aliceblue',
114 batch_button.pack(side=tk.RIGHT)
115 makeup_button = tk.Button(self.
batch_cat, bg=
'lightcyan', activebackground=
'aliceblue',
116 text=
'Makeup', command=self.parent.parent.makeup)
117 makeup_button.pack(side=tk.RIGHT)
118 submit_button = tk.Button(self.
batch_cat, bg=
'lightcyan', activebackground=
'aliceblue',
119 text=
'Submit', command=self.parent.parent.submit)
120 submit_button.pack(side=tk.RIGHT)
121 self.batch_cat.grid(row=0, column=kIDLE, columnspan=kEND-kIDLE,
122 sticky=tk.N+tk.E+tk.W+tk.S)
126 self.
stage_head = tk.Label(self, bg=
'powderblue', relief=tk.RIDGE, text=
'Stage',
127 padx=10, pady=10, font=tkinter_font.Font(size=12))
128 self.stage_head.grid(row=1, column=0, sticky=tk.N+tk.E+tk.W+tk.S)
129 self.columnconfigure(0, weight=1)
130 self.
exists_head = tk.Label(self, bg=
'lightsteelblue', relief=tk.RIDGE, text=
'Exists?',
131 padx=10, font=tkinter_font.Font(size=12))
132 self.exists_head.grid(row=1, column=kEXISTS, sticky=tk.N+tk.E+tk.W+tk.S)
133 self.columnconfigure(kEXISTS, weight=1)
134 self.
nfile_head = tk.Label(self, bg=
'lightsteelblue', relief=tk.RIDGE, text=
'Art Files',
135 padx=10, font=tkinter_font.Font(size=12))
136 self.nfile_head.grid(row=1, column=kNFILE, sticky=tk.N+tk.E+tk.W+tk.S)
137 self.columnconfigure(kNFILE, weight=1)
138 self.
nev_head = tk.Label(self, bg=
'lightsteelblue', relief=tk.RIDGE, text=
'Events',
139 padx=10, font=tkinter_font.Font(size=12))
140 self.nev_head.grid(row=1, column=kNEV, sticky=tk.N+tk.E+tk.W+tk.S)
141 self.columnconfigure(kNANA, weight=1)
142 self.
nana_head = tk.Label(self, bg=
'lightsteelblue', relief=tk.RIDGE, text=
'Ana Files',
143 padx=10, font=tkinter_font.Font(size=12))
144 self.nana_head.grid(row=1, column=kNANA, sticky=tk.N+tk.E+tk.W+tk.S)
145 self.columnconfigure(kNANA, weight=1)
146 self.
nerror_head = tk.Label(self, bg=
'lightsteelblue', relief=tk.RIDGE, text=
'Errors',
147 padx=10, font=tkinter_font.Font(size=12))
148 self.nerror_head.grid(row=1, column=kNERROR, sticky=tk.N+tk.E+tk.W+tk.S)
149 self.columnconfigure(kNERROR, weight=1)
150 self.
miss_head = tk.Label(self, bg=
'lightsteelblue', relief=tk.RIDGE, text=
'Missing',
151 padx=10, font=tkinter_font.Font(size=12))
152 self.miss_head.grid(row=1, column=kNMISS, sticky=tk.N+tk.E+tk.W+tk.S)
153 self.columnconfigure(kNMISS, weight=1)
154 self.
idle_head = tk.Label(self, bg=
'powderblue', relief=tk.RIDGE, text=
'Idle',
155 padx=10, font=tkinter_font.Font(size=12))
156 self.idle_head.grid(row=1, column=kIDLE, sticky=tk.N+tk.E+tk.W+tk.S)
157 self.columnconfigure(kIDLE, weight=1)
158 self.
running_head = tk.Label(self, bg=
'powderblue', relief=tk.RIDGE, text=
'Running',
159 padx=10, font=tkinter_font.Font(size=12))
160 self.running_head.grid(row=1, column=kRUNNING, sticky=tk.N+tk.E+tk.W+tk.S)
161 self.columnconfigure(kRUNNING, weight=1)
162 self.
held_head = tk.Label(self, bg=
'powderblue', relief=tk.RIDGE, text=
'Held',
163 padx=10, font=tkinter_font.Font(size=12))
164 self.held_head.grid(row=1, column=kHELD, sticky=tk.N+tk.E+tk.W+tk.S)
165 self.columnconfigure(kHELD, weight=1)
166 self.
other_head = tk.Label(self, bg=
'powderblue', relief=tk.RIDGE, text=
'Other',
167 padx=10, font=tkinter_font.Font(size=12))
168 self.other_head.grid(row=1, column=kOTHER, sticky=tk.N+tk.E+tk.W+tk.S)
169 self.columnconfigure(kOTHER, weight=1)
181 top=self.winfo_toplevel()
182 old_cursor = top[
'cursor']
184 top[
'cursor'] =
'watch'
185 top.update_idletasks()
188 top[
'cursor'] = old_cursor
190 top[
'cursor'] = old_cursor
192 traceback.print_tb(e[2])
193 tkinter_messagebox.showerror(
'', e[1])
197 for key
in list(self.stage_name_labels.keys()):
199 for key
in list(self.exists_labels.keys()):
201 for key
in list(self.nfile_labels.keys()):
203 for key
in list(self.nev_labels.keys()):
205 for key
in list(self.nana_labels.keys()):
207 for key
in list(self.nerror_labels.keys()):
209 for key
in list(self.nmiss_labels.keys()):
211 for key
in list(self.nidle_labels.keys()):
213 for key
in list(self.nrunning_labels.keys()):
215 for key
in list(self.nheld_labels.keys()):
217 for key
in list(self.nother_labels.keys()):
222 for stage
in project_def.stages:
224 ss = ps.get_stage_status(stage.name)
225 bss = bs.get_stage_status(stage.name)
231 font=tkinter_font.Font(size=12))
235 sticky=tk.N+tk.E+tk.W+tk.S)
236 self.rowconfigure(row, weight=1)
239 self.
exists_labels[stage.name] = tk.Label(self, bg=
'aliceblue', relief=tk.RIDGE,
240 font=tkinter_font.Font(size=12))
248 sticky=tk.N+tk.E+tk.W+tk.S)
249 self.rowconfigure(row, weight=1)
252 self.
nfile_labels[stage.name] = tk.Label(self, bg=
'aliceblue', relief=tk.RIDGE,
253 font=tkinter_font.Font(size=12))
256 sticky=tk.N+tk.E+tk.W+tk.S)
257 self.rowconfigure(row, weight=1)
260 self.
nev_labels[stage.name] = tk.Label(self, bg=
'aliceblue', relief=tk.RIDGE,
261 font=tkinter_font.Font(size=12))
262 self.
nev_labels[stage.name][
'text'] = str(ss.nev)
263 self.
nev_labels[stage.name].
grid(row=row, column=kNEV, sticky=tk.N+tk.E+tk.W+tk.S)
264 self.rowconfigure(row, weight=1)
267 self.
nana_labels[stage.name] = tk.Label(self, bg=
'aliceblue', relief=tk.RIDGE,
268 font=tkinter_font.Font(size=12))
269 self.
nana_labels[stage.name][
'text'] = str(ss.nana)
270 self.
nana_labels[stage.name].
grid(row=row, column=kNANA, sticky=tk.N+tk.E+tk.W+tk.S)
271 self.rowconfigure(row, weight=1)
274 self.
nerror_labels[stage.name] = tk.Label(self, bg=
'aliceblue', relief=tk.RIDGE,
275 font=tkinter_font.Font(size=12))
282 sticky=tk.N+tk.E+tk.W+tk.S)
283 self.rowconfigure(row, weight=1)
286 self.
nmiss_labels[stage.name] = tk.Label(self, bg=
'aliceblue', relief=tk.RIDGE,
287 font=tkinter_font.Font(size=12))
294 sticky=tk.N+tk.E+tk.W+tk.S)
295 self.rowconfigure(row, weight=1)
298 self.
nidle_labels[stage.name] = tk.Label(self, bg=
'lightcyan', relief=tk.RIDGE,
299 font=tkinter_font.Font(size=12))
302 sticky=tk.N+tk.E+tk.W+tk.S)
303 self.rowconfigure(row, weight=1)
308 font=tkinter_font.Font(size=12))
311 column=kRUNNING, sticky=tk.N+tk.E+tk.W+tk.S)
312 self.rowconfigure(row, weight=1)
315 self.
nheld_labels[stage.name] = tk.Label(self, bg=
'lightcyan', relief=tk.RIDGE,
316 font=tkinter_font.Font(size=12))
319 sticky=tk.N+tk.E+tk.W+tk.S)
320 self.rowconfigure(row, weight=1)
323 self.
nother_labels[stage.name] = tk.Label(self, bg=
'lightcyan', relief=tk.RIDGE,
324 font=tkinter_font.Font(size=12))
327 sticky=tk.N+tk.E+tk.W+tk.S)
328 self.rowconfigure(row, weight=1)
334 for key
in list(self.stage_name_labels.keys()):
362 top=self.winfo_toplevel()
363 old_cursor = top[
'cursor']
365 top[
'cursor'] =
'watch'
366 top.update_idletasks()
367 BatchStatus.update_jobs()
368 top[
'cursor'] = old_cursor
370 top[
'cursor'] = old_cursor
372 traceback.print_tb(e[2])
373 tkinter_messagebox.showerror(
'', e[1])
379 stagename = event.widget[
'text']
383 self.parent.parent.choose_stage(stagename)