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__ (self, parent, project_defs=[])
 
def make_widgets (self)
 
def set_project (self, project_defs)
 
def update_status (self)
 
def highlight_stage (self, stagename)
 
def update_jobs (self)
 
def click_stage (self, event)
 

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

Member Function Documentation

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

Definition at line 378 of file statusview.py.

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

Definition at line 333 of file statusview.py.

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

Definition at line 86 of file statusview.py.

86  def make_widgets(self):
87 
88  # Add column category headings.
89 
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',
113  text='Update', command=self.update_jobs)
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)
123 
124  # Add column headings.
125 
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)
170 
def python.statusview.ProjectStatusView.set_project (   self,
  project_defs 
)

Definition at line 173 of file statusview.py.

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

Definition at line 361 of file statusview.py.

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

Definition at line 179 of file statusview.py.

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

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: