All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
python.statusview.ProjectStatusView Class Reference
Inheritance diagram for python.statusview.ProjectStatusView:

Public Member Functions

def __init__
 
def make_widgets
 
def set_project
 
def update_status
 
def highlight_stage
 
def update_jobs
 
def click_stage
 

Public Attributes

 parent
 
 project_defs
 
 stage_name_labels
 
 exists_labels
 
 nfile_labels
 
 nev_labels
 
 nana_labels
 
 nerror_labels
 
 nmiss_labels
 
 nidle_labels
 
 nrunning_labels
 
 nheld_labels
 
 nother_labels
 
 stage_cat
 
 files_cat
 
 batch_cat
 
 stage_head
 
 exists_head
 
 nfile_head
 
 nev_head
 
 nana_head
 
 nerror_head
 
 miss_head
 
 idle_head
 
 running_head
 
 held_head
 
 other_head
 

Detailed Description

Definition at line 48 of file statusview.py.

Constructor & Destructor Documentation

def python.statusview.ProjectStatusView.__init__ (   self,
  parent,
  project_defs = [] 
)

Definition at line 52 of file statusview.py.

52 
53  def __init__(self, parent, project_defs=[]):
54 
55 
56  self.parent = parent
57  self.project_defs = project_defs
58 
59  # Register our outermost frame in the parent window.
60 
61  tk.Frame.__init__(self, self.parent)
62  self.pack(expand=1, fill=tk.BOTH)
63  self.rowconfigure(0, weight=1)
64 
65  # Dictionaries to hold stage widgets.
66 
68  self.exists_labels = {}
69  self.nfile_labels = {}
70  self.nev_labels = {}
71  self.nana_labels = {}
72  self.nerror_labels = {}
73  self.nmiss_labels = {}
74  self.nidle_labels = {}
75  self.nrunning_labels = {}
76  self.nheld_labels = {}
77  self.nother_labels = {}
78 
79  # Make widgets that belong to this widget.
80 
81  self.make_widgets()
82  if len(self.project_defs) > 0:
83  self.update_status()

Member Function Documentation

def python.statusview.ProjectStatusView.click_stage (   self,
  event 
)

Definition at line 378 of file statusview.py.

379  def click_stage(self, event):
380  stagename = event.widget['text']
381 
382  # Choose stage in parent app.
383 
384  self.parent.parent.choose_stage(stagename)
def python.statusview.ProjectStatusView.highlight_stage (   self,
  stagename 
)

Definition at line 333 of file statusview.py.

334  def highlight_stage(self, stagename):
335  for key in list(self.stage_name_labels.keys()):
336  self.stage_name_labels[key]['bg'] = 'powderblue'
337  self.exists_labels[key]['bg'] = 'aliceblue'
338  self.nfile_labels[key]['bg'] = 'aliceblue'
339  self.nev_labels[key]['bg'] = 'aliceblue'
340  self.nana_labels[key]['bg'] = 'aliceblue'
341  self.nerror_labels[key]['bg'] = 'aliceblue'
342  self.nmiss_labels[key]['bg'] = 'aliceblue'
343  self.nidle_labels[key]['bg'] = 'lightcyan'
344  self.nrunning_labels[key]['bg'] = 'lightcyan'
345  self.nheld_labels[key]['bg'] = 'lightcyan'
346  self.nother_labels[key]['bg'] = 'lightcyan'
347  if stagename in self.stage_name_labels:
348  self.stage_name_labels[stagename]['bg'] = 'white'
349  self.exists_labels[stagename]['bg'] = 'white'
350  self.nfile_labels[stagename]['bg'] = 'white'
351  self.nev_labels[stagename]['bg'] = 'white'
352  self.nana_labels[stagename]['bg'] = 'white'
353  self.nerror_labels[stagename]['bg'] = 'white'
354  self.nmiss_labels[stagename]['bg'] = 'white'
355  self.nidle_labels[stagename]['bg'] = 'white'
356  self.nrunning_labels[stagename]['bg'] = 'white'
357  self.nheld_labels[stagename]['bg'] = 'white'
358  self.nother_labels[stagename]['bg'] = 'white'
list
Definition: file_to_url.sh:28
def python.statusview.ProjectStatusView.make_widgets (   self)

Definition at line 86 of file statusview.py.

86 
87  def make_widgets(self):
88 
89  # Add column category headings.
90 
91  self.stage_cat = tk.Label(self, bg='powderblue', relief=tk.RIDGE, text='',
92  padx=10, pady=10, font=tkinter_font.Font(size=12))
93  self.stage_cat.grid(row=0, column=0, sticky=tk.N+tk.E+tk.W+tk.S)
94  self.files_cat = tk.Frame(self, bd=1, relief=tk.SUNKEN, bg='lightsteelblue')
95  files_label = tk.Label(self.files_cat, bg='lightsteelblue', relief=tk.FLAT, text='Output',
96  padx=10, font=tkinter_font.Font(size=12))
97  files_label.pack(side=tk.LEFT, expand=1, fill=tk.BOTH)
98  fetchlog_button = tk.Button(self.files_cat, bg='lightcyan', activebackground='aliceblue',
99  text='Fetchlog', command=self.parent.parent.fetchlog)
100  fetchlog_button.pack(side=tk.RIGHT)
101  checkana_button = tk.Button(self.files_cat, bg='lightcyan', activebackground='aliceblue',
102  text='CheckAna', command=self.parent.parent.checkana)
103  checkana_button.pack(side=tk.RIGHT)
104  check_button = tk.Button(self.files_cat, bg='lightcyan', activebackground='aliceblue',
105  text='Check', command=self.parent.parent.check)
106  check_button.pack(side=tk.RIGHT)
107  self.files_cat.grid(row=0, column=kEXISTS, columnspan=kIDLE-kEXISTS,
108  sticky=tk.N+tk.E+tk.W+tk.S)
109  self.batch_cat = tk.Frame(self, bd=1, relief=tk.SUNKEN, bg='powderblue')
110  batch_label = tk.Label(self.batch_cat, bg='powderblue', relief=tk.FLAT, text='Batch Jobs',
111  padx=10, font=tkinter_font.Font(size=12))
112  batch_label.pack(side=tk.LEFT, expand=1, fill=tk.BOTH)
113  batch_button = tk.Button(self.batch_cat, bg='lightcyan', activebackground='aliceblue',
114  text='Update', command=self.update_jobs)
115  batch_button.pack(side=tk.RIGHT)
116  makeup_button = tk.Button(self.batch_cat, bg='lightcyan', activebackground='aliceblue',
117  text='Makeup', command=self.parent.parent.makeup)
118  makeup_button.pack(side=tk.RIGHT)
119  submit_button = tk.Button(self.batch_cat, bg='lightcyan', activebackground='aliceblue',
120  text='Submit', command=self.parent.parent.submit)
121  submit_button.pack(side=tk.RIGHT)
122  self.batch_cat.grid(row=0, column=kIDLE, columnspan=kEND-kIDLE,
123  sticky=tk.N+tk.E+tk.W+tk.S)
124 
125  # Add column headings.
127  self.stage_head = tk.Label(self, bg='powderblue', relief=tk.RIDGE, text='Stage',
128  padx=10, pady=10, font=tkinter_font.Font(size=12))
129  self.stage_head.grid(row=1, column=0, sticky=tk.N+tk.E+tk.W+tk.S)
130  self.columnconfigure(0, weight=1)
131  self.exists_head = tk.Label(self, bg='lightsteelblue', relief=tk.RIDGE, text='Exists?',
132  padx=10, font=tkinter_font.Font(size=12))
133  self.exists_head.grid(row=1, column=kEXISTS, sticky=tk.N+tk.E+tk.W+tk.S)
134  self.columnconfigure(kEXISTS, weight=1)
135  self.nfile_head = tk.Label(self, bg='lightsteelblue', relief=tk.RIDGE, text='Art Files',
136  padx=10, font=tkinter_font.Font(size=12))
137  self.nfile_head.grid(row=1, column=kNFILE, sticky=tk.N+tk.E+tk.W+tk.S)
138  self.columnconfigure(kNFILE, weight=1)
139  self.nev_head = tk.Label(self, bg='lightsteelblue', relief=tk.RIDGE, text='Events',
140  padx=10, font=tkinter_font.Font(size=12))
141  self.nev_head.grid(row=1, column=kNEV, sticky=tk.N+tk.E+tk.W+tk.S)
142  self.columnconfigure(kNANA, weight=1)
143  self.nana_head = tk.Label(self, bg='lightsteelblue', relief=tk.RIDGE, text='Ana Files',
144  padx=10, font=tkinter_font.Font(size=12))
145  self.nana_head.grid(row=1, column=kNANA, sticky=tk.N+tk.E+tk.W+tk.S)
146  self.columnconfigure(kNANA, weight=1)
147  self.nerror_head = tk.Label(self, bg='lightsteelblue', relief=tk.RIDGE, text='Errors',
148  padx=10, font=tkinter_font.Font(size=12))
149  self.nerror_head.grid(row=1, column=kNERROR, sticky=tk.N+tk.E+tk.W+tk.S)
150  self.columnconfigure(kNERROR, weight=1)
151  self.miss_head = tk.Label(self, bg='lightsteelblue', relief=tk.RIDGE, text='Missing',
152  padx=10, font=tkinter_font.Font(size=12))
153  self.miss_head.grid(row=1, column=kNMISS, sticky=tk.N+tk.E+tk.W+tk.S)
154  self.columnconfigure(kNMISS, weight=1)
155  self.idle_head = tk.Label(self, bg='powderblue', relief=tk.RIDGE, text='Idle',
156  padx=10, font=tkinter_font.Font(size=12))
157  self.idle_head.grid(row=1, column=kIDLE, sticky=tk.N+tk.E+tk.W+tk.S)
158  self.columnconfigure(kIDLE, weight=1)
159  self.running_head = tk.Label(self, bg='powderblue', relief=tk.RIDGE, text='Running',
160  padx=10, font=tkinter_font.Font(size=12))
161  self.running_head.grid(row=1, column=kRUNNING, sticky=tk.N+tk.E+tk.W+tk.S)
162  self.columnconfigure(kRUNNING, weight=1)
163  self.held_head = tk.Label(self, bg='powderblue', relief=tk.RIDGE, text='Held',
164  padx=10, font=tkinter_font.Font(size=12))
165  self.held_head.grid(row=1, column=kHELD, sticky=tk.N+tk.E+tk.W+tk.S)
166  self.columnconfigure(kHELD, weight=1)
167  self.other_head = tk.Label(self, bg='powderblue', relief=tk.RIDGE, text='Other',
168  padx=10, font=tkinter_font.Font(size=12))
169  self.other_head.grid(row=1, column=kOTHER, sticky=tk.N+tk.E+tk.W+tk.S)
170  self.columnconfigure(kOTHER, weight=1)
def python.statusview.ProjectStatusView.set_project (   self,
  project_defs 
)

Definition at line 173 of file statusview.py.

174  def set_project(self, project_defs):
175  self.project_defs = project_defs
176  self.update_status()
def python.statusview.ProjectStatusView.update_jobs (   self)

Definition at line 361 of file statusview.py.

362  def update_jobs(self):
363  top=self.winfo_toplevel()
364  old_cursor = top['cursor']
365  try:
366  top['cursor'] = 'watch'
367  top.update_idletasks()
368  BatchStatus.update_jobs()
369  top['cursor'] = old_cursor
370  except:
371  top['cursor'] = old_cursor
372  e = sys.exc_info()
373  traceback.print_tb(e[2])
374  tkinter_messagebox.showerror('', e[1])
375  self.update_status()
def python.statusview.ProjectStatusView.update_status (   self)

Definition at line 179 of file statusview.py.

180  def update_status(self):
181 
182  top=self.winfo_toplevel()
183  old_cursor = top['cursor']
184  try:
185  top['cursor'] = 'watch'
186  top.update_idletasks()
187  ps = ProjectStatus(self.project_defs)
188  bs = BatchStatus(self.project_defs)
189  top['cursor'] = old_cursor
190  except:
191  top['cursor'] = old_cursor
192  e = sys.exc_info()
193  traceback.print_tb(e[2])
194  tkinter_messagebox.showerror('', e[1])
195 
196  # Update label widgets.
197 
198  for key in list(self.stage_name_labels.keys()):
199  self.stage_name_labels[key].grid_forget()
200  for key in list(self.exists_labels.keys()):
201  self.exists_labels[key].grid_forget()
202  for key in list(self.nfile_labels.keys()):
203  self.nfile_labels[key].grid_forget()
204  for key in list(self.nev_labels.keys()):
205  self.nev_labels[key].grid_forget()
206  for key in list(self.nana_labels.keys()):
207  self.nana_labels[key].grid_forget()
208  for key in list(self.nerror_labels.keys()):
209  self.nerror_labels[key].grid_forget()
210  for key in list(self.nmiss_labels.keys()):
211  self.nmiss_labels[key].grid_forget()
212  for key in list(self.nidle_labels.keys()):
213  self.nidle_labels[key].grid_forget()
214  for key in list(self.nrunning_labels.keys()):
215  self.nrunning_labels[key].grid_forget()
216  for key in list(self.nheld_labels.keys()):
217  self.nheld_labels[key].grid_forget()
218  for key in list(self.nother_labels.keys()):
219  self.nother_labels[key].grid_forget()
220 
221  row = 1
222  for project_def in self.project_defs:
223  for stage in project_def.stages:
224  row = row + 1
225  ss = ps.get_stage_status(stage.name)
226  bss = bs.get_stage_status(stage.name)
227 
228  if stage.name not in self.stage_name_labels:
229  self.stage_name_labels[stage.name] = tk.Label(self, bg='powderblue',
230  relief=tk.RIDGE,
231  padx=10, pady=5,
232  font=tkinter_font.Font(size=12))
233  self.stage_name_labels[stage.name]['text'] = stage.name
234  self.stage_name_labels[stage.name].bind('<Button-1>', self.click_stage)
235  self.stage_name_labels[stage.name].grid(row=row, column=0,
236  sticky=tk.N+tk.E+tk.W+tk.S)
237  self.rowconfigure(row, weight=1)
238 
239  if stage.name not in self.exists_labels:
240  self.exists_labels[stage.name] = tk.Label(self, bg='aliceblue', relief=tk.RIDGE,
241  font=tkinter_font.Font(size=12))
242  if ss.exists:
243  self.exists_labels[stage.name]['text'] = 'Yes'
244  self.exists_labels[stage.name]['fg'] = 'black'
245  else:
246  self.exists_labels[stage.name]['text'] = 'No'
247  self.exists_labels[stage.name]['fg'] = 'red'
248  self.exists_labels[stage.name].grid(row=row, column=kEXISTS,
249  sticky=tk.N+tk.E+tk.W+tk.S)
250  self.rowconfigure(row, weight=1)
251 
252  if stage.name not in self.nfile_labels:
253  self.nfile_labels[stage.name] = tk.Label(self, bg='aliceblue', relief=tk.RIDGE,
254  font=tkinter_font.Font(size=12))
255  self.nfile_labels[stage.name]['text'] = str(ss.nfile)
256  self.nfile_labels[stage.name].grid(row=row, column=kNFILE,
257  sticky=tk.N+tk.E+tk.W+tk.S)
258  self.rowconfigure(row, weight=1)
259 
260  if stage.name not in self.nev_labels:
261  self.nev_labels[stage.name] = tk.Label(self, bg='aliceblue', relief=tk.RIDGE,
262  font=tkinter_font.Font(size=12))
263  self.nev_labels[stage.name]['text'] = str(ss.nev)
264  self.nev_labels[stage.name].grid(row=row, column=kNEV, sticky=tk.N+tk.E+tk.W+tk.S)
265  self.rowconfigure(row, weight=1)
266 
267  if stage.name not in self.nana_labels:
268  self.nana_labels[stage.name] = tk.Label(self, bg='aliceblue', relief=tk.RIDGE,
269  font=tkinter_font.Font(size=12))
270  self.nana_labels[stage.name]['text'] = str(ss.nana)
271  self.nana_labels[stage.name].grid(row=row, column=kNANA, sticky=tk.N+tk.E+tk.W+tk.S)
272  self.rowconfigure(row, weight=1)
273 
274  if stage.name not in self.nerror_labels:
275  self.nerror_labels[stage.name] = tk.Label(self, bg='aliceblue', relief=tk.RIDGE,
276  font=tkinter_font.Font(size=12))
277  self.nerror_labels[stage.name]['text'] = str(ss.nerror)
278  if ss.nerror == 0:
279  self.nerror_labels[stage.name]['fg'] = 'black'
280  else:
281  self.nerror_labels[stage.name]['fg'] = 'red'
282  self.nerror_labels[stage.name].grid(row=row, column=kNERROR,
283  sticky=tk.N+tk.E+tk.W+tk.S)
284  self.rowconfigure(row, weight=1)
285 
286  if stage.name not in self.nmiss_labels:
287  self.nmiss_labels[stage.name] = tk.Label(self, bg='aliceblue', relief=tk.RIDGE,
288  font=tkinter_font.Font(size=12))
289  self.nmiss_labels[stage.name]['text'] = str(ss.nmiss)
290  if ss.nmiss == 0:
291  self.nmiss_labels[stage.name]['fg'] = 'black'
292  else:
293  self.nmiss_labels[stage.name]['fg'] = 'red'
294  self.nmiss_labels[stage.name].grid(row=row, column=kNMISS,
295  sticky=tk.N+tk.E+tk.W+tk.S)
296  self.rowconfigure(row, weight=1)
297 
298  if stage.name not in self.nidle_labels:
299  self.nidle_labels[stage.name] = tk.Label(self, bg='lightcyan', relief=tk.RIDGE,
300  font=tkinter_font.Font(size=12))
301  self.nidle_labels[stage.name]['text'] = bss[0]
302  self.nidle_labels[stage.name].grid(row=row, column=kIDLE,
303  sticky=tk.N+tk.E+tk.W+tk.S)
304  self.rowconfigure(row, weight=1)
305 
306  if stage.name not in self.nrunning_labels:
307  self.nrunning_labels[stage.name] = tk.Label(self, bg='lightcyan',
308  relief=tk.RIDGE,
309  font=tkinter_font.Font(size=12))
310  self.nrunning_labels[stage.name]['text'] = bss[1]
311  self.nrunning_labels[stage.name].grid(row=row,
312  column=kRUNNING, sticky=tk.N+tk.E+tk.W+tk.S)
313  self.rowconfigure(row, weight=1)
314 
315  if stage.name not in self.nheld_labels:
316  self.nheld_labels[stage.name] = tk.Label(self, bg='lightcyan', relief=tk.RIDGE,
317  font=tkinter_font.Font(size=12))
318  self.nheld_labels[stage.name]['text'] = bss[2]
319  self.nheld_labels[stage.name].grid(row=row, column=kHELD,
320  sticky=tk.N+tk.E+tk.W+tk.S)
321  self.rowconfigure(row, weight=1)
322 
323  if stage.name not in self.nother_labels:
324  self.nother_labels[stage.name] = tk.Label(self, bg='lightcyan', relief=tk.RIDGE,
325  font=tkinter_font.Font(size=12))
326  self.nother_labels[stage.name]['text'] = bss[3]
327  self.nother_labels[stage.name].grid(row=row, column=kOTHER,
328  sticky=tk.N+tk.E+tk.W+tk.S)
329  self.rowconfigure(row, weight=1)
330 
g grid
list
Definition: file_to_url.sh:28

Member Data Documentation

python.statusview.ProjectStatusView.batch_cat

Definition at line 108 of file statusview.py.

python.statusview.ProjectStatusView.exists_head

Definition at line 130 of file statusview.py.

python.statusview.ProjectStatusView.exists_labels

Definition at line 67 of file statusview.py.

python.statusview.ProjectStatusView.files_cat

Definition at line 93 of file statusview.py.

python.statusview.ProjectStatusView.held_head

Definition at line 162 of file statusview.py.

python.statusview.ProjectStatusView.idle_head

Definition at line 154 of file statusview.py.

python.statusview.ProjectStatusView.miss_head

Definition at line 150 of file statusview.py.

python.statusview.ProjectStatusView.nana_head

Definition at line 142 of file statusview.py.

python.statusview.ProjectStatusView.nana_labels

Definition at line 70 of file statusview.py.

python.statusview.ProjectStatusView.nerror_head

Definition at line 146 of file statusview.py.

python.statusview.ProjectStatusView.nerror_labels

Definition at line 71 of file statusview.py.

python.statusview.ProjectStatusView.nev_head

Definition at line 138 of file statusview.py.

python.statusview.ProjectStatusView.nev_labels

Definition at line 69 of file statusview.py.

python.statusview.ProjectStatusView.nfile_head

Definition at line 134 of file statusview.py.

python.statusview.ProjectStatusView.nfile_labels

Definition at line 68 of file statusview.py.

python.statusview.ProjectStatusView.nheld_labels

Definition at line 75 of file statusview.py.

python.statusview.ProjectStatusView.nidle_labels

Definition at line 73 of file statusview.py.

python.statusview.ProjectStatusView.nmiss_labels

Definition at line 72 of file statusview.py.

python.statusview.ProjectStatusView.nother_labels

Definition at line 76 of file statusview.py.

python.statusview.ProjectStatusView.nrunning_labels

Definition at line 74 of file statusview.py.

python.statusview.ProjectStatusView.other_head

Definition at line 166 of file statusview.py.

python.statusview.ProjectStatusView.parent

Definition at line 55 of file statusview.py.

python.statusview.ProjectStatusView.project_defs

Definition at line 56 of file statusview.py.

python.statusview.ProjectStatusView.running_head

Definition at line 158 of file statusview.py.

python.statusview.ProjectStatusView.stage_cat

Definition at line 90 of file statusview.py.

python.statusview.ProjectStatusView.stage_head

Definition at line 126 of file statusview.py.

python.statusview.ProjectStatusView.stage_name_labels

Definition at line 66 of file statusview.py.


The documentation for this class was generated from the following file: