1 | #!/usr/bin/python |
---|
2 | |
---|
3 | """ |
---|
4 | This software was developed by Institut Laue-Langevin as part of |
---|
5 | Distributed Data Analysis of Neutron Scattering Experiments (DANSE). |
---|
6 | |
---|
7 | Copyright 2012 Institut Laue-Langevin |
---|
8 | |
---|
9 | """ |
---|
10 | |
---|
11 | |
---|
12 | import wx |
---|
13 | import sys |
---|
14 | import os |
---|
15 | from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin |
---|
16 | from collections import defaultdict |
---|
17 | import json |
---|
18 | from sans.guiframe.events import ChangeCategoryEvent |
---|
19 | from sans.guiframe.CategoryInstaller import CategoryInstaller |
---|
20 | IS_MAC = (sys.platform == 'darwin') |
---|
21 | |
---|
22 | """ Notes |
---|
23 | The category manager mechanism works from 3 data structures used: |
---|
24 | - self.master_category_dict: keys are the names of categories, |
---|
25 | the values are lists of tuples, |
---|
26 | the first being the model names (the models belonging to that |
---|
27 | category), the second a boolean |
---|
28 | of whether or not the model is enabled |
---|
29 | - self.by_model_dict: keys are model names, values are a list |
---|
30 | of categories belonging to that model |
---|
31 | - self.model_enabled_dict: keys are model names, values are |
---|
32 | bools of whether the model is enabled |
---|
33 | use self._regenerate_model_dict() to create the latter two |
---|
34 | structures from the former |
---|
35 | use self._regenerate_master_dict() to create the first |
---|
36 | structure from the latter two |
---|
37 | |
---|
38 | The need for so many data structures comes from the fact |
---|
39 | sometimes we need fast access |
---|
40 | to all the models in a category (eg user selection from the gui) |
---|
41 | and sometimes we need access to all the categories |
---|
42 | corresponding to a model (eg user modification of model categories) |
---|
43 | |
---|
44 | """ |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin, |
---|
49 | ListCtrlAutoWidthMixin): |
---|
50 | """ |
---|
51 | Taken from |
---|
52 | http://zetcode.com/wxpython/advanced/ |
---|
53 | """ |
---|
54 | |
---|
55 | def __init__(self, parent, callback_func): |
---|
56 | """ |
---|
57 | Initialization |
---|
58 | :param parent: Parent window |
---|
59 | :param callback_func: A function to be called when |
---|
60 | an element is clicked |
---|
61 | """ |
---|
62 | wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT \ |
---|
63 | | wx.SUNKEN_BORDER) |
---|
64 | CheckListCtrlMixin.__init__(self) |
---|
65 | ListCtrlAutoWidthMixin.__init__(self) |
---|
66 | |
---|
67 | self.callback_func = callback_func |
---|
68 | |
---|
69 | def OnCheckItem(self, index, flag): |
---|
70 | """ |
---|
71 | When the user checks the item we need to save that state |
---|
72 | """ |
---|
73 | self.callback_func(index, flag) |
---|
74 | |
---|
75 | |
---|
76 | class CategoryManager(wx.Frame): |
---|
77 | """ |
---|
78 | A class for managing categories |
---|
79 | """ |
---|
80 | def __init__(self, parent, win_id, title): |
---|
81 | """ |
---|
82 | Category Manager Dialog class |
---|
83 | :param win_id: A new wx ID |
---|
84 | :param title: Title for the window |
---|
85 | """ |
---|
86 | |
---|
87 | # make sure the category file is where it should be |
---|
88 | self.performance_blocking = False |
---|
89 | |
---|
90 | self.master_category_dict = defaultdict(list) |
---|
91 | self.by_model_dict = defaultdict(list) |
---|
92 | self.model_enabled_dict = defaultdict(bool) |
---|
93 | |
---|
94 | wx.Frame.__init__(self, parent, win_id, title, size=(660, 400)) |
---|
95 | |
---|
96 | panel = wx.Panel(self, -1) |
---|
97 | self.parent = parent |
---|
98 | |
---|
99 | self._read_category_info() |
---|
100 | |
---|
101 | |
---|
102 | vbox = wx.BoxSizer(wx.VERTICAL) |
---|
103 | hbox = wx.BoxSizer(wx.HORIZONTAL) |
---|
104 | |
---|
105 | left_panel = wx.Panel(panel, -1) |
---|
106 | right_panel = wx.Panel(panel, -1) |
---|
107 | |
---|
108 | self.cat_list = CheckListCtrl(right_panel, self._on_check) |
---|
109 | self.cat_list.InsertColumn(0, 'Model', width = 280) |
---|
110 | self.cat_list.InsertColumn(1, 'Category', width = 240) |
---|
111 | |
---|
112 | self._fill_lists() |
---|
113 | self._regenerate_model_dict() |
---|
114 | self._set_enabled() |
---|
115 | |
---|
116 | vbox2 = wx.BoxSizer(wx.VERTICAL) |
---|
117 | |
---|
118 | sel = wx.Button(left_panel, -1, 'Enable All', size=(100, -1)) |
---|
119 | des = wx.Button(left_panel, -1, 'Disable All', size=(100, -1)) |
---|
120 | modify_button = wx.Button(left_panel, -1, 'Modify', |
---|
121 | size=(100, -1)) |
---|
122 | ok_button = wx.Button(left_panel, -1, 'OK', size=(100, -1)) |
---|
123 | cancel_button = wx.Button(left_panel, -1, 'Cancel', |
---|
124 | size=(100, -1)) |
---|
125 | |
---|
126 | |
---|
127 | |
---|
128 | self.Bind(wx.EVT_BUTTON, self._on_selectall, |
---|
129 | id=sel.GetId()) |
---|
130 | self.Bind(wx.EVT_BUTTON, self._on_deselectall, |
---|
131 | id=des.GetId()) |
---|
132 | self.Bind(wx.EVT_BUTTON, self._on_apply, |
---|
133 | id = modify_button.GetId()) |
---|
134 | self.Bind(wx.EVT_BUTTON, self._on_ok, |
---|
135 | id = ok_button.GetId()) |
---|
136 | self.Bind(wx.EVT_BUTTON, self._on_cancel, |
---|
137 | id = cancel_button.GetId()) |
---|
138 | |
---|
139 | vbox2.Add(modify_button, 0, wx.TOP, 10) |
---|
140 | vbox2.Add((-1, 20)) |
---|
141 | vbox2.Add(sel) |
---|
142 | vbox2.Add(des) |
---|
143 | vbox2.Add((-1, 20)) |
---|
144 | vbox2.Add(ok_button) |
---|
145 | vbox2.Add(cancel_button) |
---|
146 | |
---|
147 | left_panel.SetSizer(vbox2) |
---|
148 | |
---|
149 | vbox.Add(self.cat_list, 1, wx.EXPAND | wx.TOP, 3) |
---|
150 | vbox.Add((-1, 10)) |
---|
151 | |
---|
152 | |
---|
153 | right_panel.SetSizer(vbox) |
---|
154 | |
---|
155 | hbox.Add(left_panel, 0, wx.EXPAND | wx.RIGHT, 5) |
---|
156 | hbox.Add(right_panel, 1, wx.EXPAND) |
---|
157 | hbox.Add((3, -1)) |
---|
158 | |
---|
159 | panel.SetSizer(hbox) |
---|
160 | self.performance_blocking = True |
---|
161 | |
---|
162 | |
---|
163 | self.Centre() |
---|
164 | self.Show(True) |
---|
165 | |
---|
166 | # gui stuff finished |
---|
167 | |
---|
168 | def _on_check(self, index, flag): |
---|
169 | """ |
---|
170 | When the user checks an item we need to immediately save that state. |
---|
171 | :param index: The index of the checked item |
---|
172 | :param flag: True or False whether the item was checked |
---|
173 | """ |
---|
174 | if self.performance_blocking: |
---|
175 | # for computational reasons we don't want to |
---|
176 | # call this function every time the gui is set up |
---|
177 | model_name = self.cat_list.GetItem(index, 0).GetText() |
---|
178 | self.model_enabled_dict[model_name] = flag |
---|
179 | self._regenerate_master_dict() |
---|
180 | |
---|
181 | |
---|
182 | def _fill_lists(self): |
---|
183 | """ |
---|
184 | Expands lists on the GUI |
---|
185 | """ |
---|
186 | ## This method loops through all the models in the category by model |
---|
187 | ## list and for each one converts the dictionary item to a string |
---|
188 | ## which has of course two terms: the model and the category (in that |
---|
189 | ## order). The text string however directly reads the quotes, brackets, |
---|
190 | ## and encoding term (u in our case) and does not understand them |
---|
191 | ## as dictionary and list separators. Thus we then have to strip those |
---|
192 | ## out. Also note the text control box, cat_list, has already been made into |
---|
193 | ## a two column list with a check box. |
---|
194 | ## |
---|
195 | ## This works but is ugly to me (should not have to manually strip). |
---|
196 | ## had to add the u stripping for the json encoding |
---|
197 | ## |
---|
198 | ## - PDB April 26, 2014 |
---|
199 | ## |
---|
200 | self.cat_list.DeleteAllItems() |
---|
201 | model_name_list = [model for model in self.by_model_dict] |
---|
202 | model_name_list.sort() |
---|
203 | |
---|
204 | for model in model_name_list: |
---|
205 | index = self.cat_list.InsertStringItem(sys.maxint, model) |
---|
206 | self.cat_list.SetStringItem(index, 1, \ |
---|
207 | str(self.by_model_dict[model]).\ |
---|
208 | replace("u'","").\ |
---|
209 | replace("'","").\ |
---|
210 | replace("[","").\ |
---|
211 | replace("]","")) |
---|
212 | |
---|
213 | |
---|
214 | |
---|
215 | def _set_enabled(self): |
---|
216 | """ |
---|
217 | Updates enabled models from self.model_enabled_dict |
---|
218 | """ |
---|
219 | num = self.cat_list.GetItemCount() |
---|
220 | for i in range(num): |
---|
221 | model_name = self.cat_list.GetItem(i, 0).GetText() |
---|
222 | self.cat_list.CheckItem(i, |
---|
223 | self.model_enabled_dict[model_name] ) |
---|
224 | |
---|
225 | |
---|
226 | |
---|
227 | def _on_selectall(self, event): |
---|
228 | """ |
---|
229 | Callback for 'enable all' |
---|
230 | """ |
---|
231 | self.performance_blocking = False |
---|
232 | num = self.cat_list.GetItemCount() |
---|
233 | for i in range(num): |
---|
234 | self.cat_list.CheckItem(i) |
---|
235 | for model in self.model_enabled_dict: |
---|
236 | self.model_enabled_dict[model] = True |
---|
237 | self._regenerate_master_dict() |
---|
238 | self.performance_blocking = True |
---|
239 | |
---|
240 | def _on_deselectall(self, event): |
---|
241 | """ |
---|
242 | Callback for 'disable all' |
---|
243 | """ |
---|
244 | self.performance_blocking = False |
---|
245 | num = self.cat_list.GetItemCount() |
---|
246 | for i in range(num): |
---|
247 | self.cat_list.CheckItem(i, False) |
---|
248 | for model in self.model_enabled_dict: |
---|
249 | self.model_enabled_dict[model] = False |
---|
250 | self._regenerate_master_dict() |
---|
251 | self.performance_blocking = True |
---|
252 | |
---|
253 | def _on_apply(self, event): |
---|
254 | """ |
---|
255 | Call up the 'ChangeCat' dialog for category editing |
---|
256 | """ |
---|
257 | |
---|
258 | if self.cat_list.GetSelectedItemCount() == 0: |
---|
259 | wx.MessageBox('Please select a model', 'Error', |
---|
260 | wx.OK | wx.ICON_EXCLAMATION ) |
---|
261 | |
---|
262 | else: |
---|
263 | selected_model = \ |
---|
264 | self.cat_list.GetItem(\ |
---|
265 | self.cat_list.GetFirstSelected(), 0).GetText() |
---|
266 | |
---|
267 | |
---|
268 | modify_dialog = ChangeCat(self, selected_model, |
---|
269 | self._get_cat_list(), |
---|
270 | self.by_model_dict[selected_model]) |
---|
271 | |
---|
272 | if modify_dialog.ShowModal() == wx.ID_OK: |
---|
273 | if not IS_MAC: |
---|
274 | self.dial_ok(modify_dialog, selected_model) |
---|
275 | |
---|
276 | def dial_ok(self, dialog=None, model=None): |
---|
277 | """ |
---|
278 | modify_dialog onclose |
---|
279 | """ |
---|
280 | self.by_model_dict[model] = dialog.get_category() |
---|
281 | self._regenerate_master_dict() |
---|
282 | self._fill_lists() |
---|
283 | self._set_enabled() |
---|
284 | |
---|
285 | |
---|
286 | def _on_ok(self, event): |
---|
287 | """ |
---|
288 | Close the manager |
---|
289 | """ |
---|
290 | self._save_state() |
---|
291 | evt = ChangeCategoryEvent() |
---|
292 | wx.PostEvent(self.parent, evt) |
---|
293 | |
---|
294 | self.Destroy() |
---|
295 | |
---|
296 | def _on_cancel(self, event): |
---|
297 | """ |
---|
298 | On cancel |
---|
299 | """ |
---|
300 | self.Destroy() |
---|
301 | |
---|
302 | def _save_state(self): |
---|
303 | """ |
---|
304 | Serializes categorization info to file |
---|
305 | """ |
---|
306 | |
---|
307 | self._regenerate_master_dict() |
---|
308 | |
---|
309 | cat_file = open(CategoryInstaller.get_user_file(), 'wb') |
---|
310 | |
---|
311 | json.dump(self.master_category_dict, cat_file ) |
---|
312 | |
---|
313 | cat_file.close() |
---|
314 | |
---|
315 | def _read_category_info(self): |
---|
316 | """ |
---|
317 | Read in categorization info from file |
---|
318 | """ |
---|
319 | try: |
---|
320 | file = CategoryInstaller.get_user_file() |
---|
321 | if os.path.isfile(file): |
---|
322 | cat_file = open(file, 'rb') |
---|
323 | # self.master_category_dict = pickle.load(cat_file) |
---|
324 | self.master_category_dict = json.load(cat_file) |
---|
325 | else: |
---|
326 | cat_file = open(CategoryInstaller.get_default_file(), 'rb') |
---|
327 | # self.master_category_dict = pickle.load(cat_file) |
---|
328 | self.master_category_dict = json.load(cat_file) |
---|
329 | cat_file.close() |
---|
330 | except IOError: |
---|
331 | print 'Problem reading in category file. Please review' |
---|
332 | |
---|
333 | |
---|
334 | self._regenerate_model_dict() |
---|
335 | |
---|
336 | def _get_cat_list(self): |
---|
337 | """ |
---|
338 | Returns a simple list of categories |
---|
339 | """ |
---|
340 | cat_list = list() |
---|
341 | for category in self.master_category_dict.iterkeys(): |
---|
342 | if not category == 'Uncategorized': |
---|
343 | cat_list.append(category) |
---|
344 | |
---|
345 | return cat_list |
---|
346 | |
---|
347 | def _regenerate_model_dict(self): |
---|
348 | """ |
---|
349 | regenerates self.by_model_dict which has each model |
---|
350 | name as the key |
---|
351 | and the list of categories belonging to that model |
---|
352 | along with the enabled mapping |
---|
353 | """ |
---|
354 | self.by_model_dict = defaultdict(list) |
---|
355 | for category in self.master_category_dict: |
---|
356 | for (model, enabled) in self.master_category_dict[category]: |
---|
357 | self.by_model_dict[model].append(category) |
---|
358 | self.model_enabled_dict[model] = enabled |
---|
359 | print self.master_category_dict |
---|
360 | print self.by_model_dict |
---|
361 | print self.model_enabled_dict |
---|
362 | |
---|
363 | def _regenerate_master_dict(self): |
---|
364 | """ |
---|
365 | regenerates self.master_category_dict from |
---|
366 | self.by_model_dict and self.model_enabled_dict |
---|
367 | """ |
---|
368 | self.master_category_dict = defaultdict(list) |
---|
369 | for model in self.by_model_dict: |
---|
370 | for category in self.by_model_dict[model]: |
---|
371 | self.master_category_dict[category].append\ |
---|
372 | ((model, self.model_enabled_dict[model])) |
---|
373 | |
---|
374 | |
---|
375 | |
---|
376 | class ChangeCat(wx.Dialog): |
---|
377 | """ |
---|
378 | dialog for changing the categories of a model |
---|
379 | """ |
---|
380 | |
---|
381 | def __init__(self, parent, title, cat_list, current_cats): |
---|
382 | """ |
---|
383 | Actual editor for a certain category |
---|
384 | :param parent: Window parent |
---|
385 | :param title: Window title |
---|
386 | :param cat_list: List of all categories |
---|
387 | :param current_cats: List of categories applied to current model |
---|
388 | """ |
---|
389 | wx.Dialog.__init__(self, parent, title = 'Change Category: '+title, size=(485, 425)) |
---|
390 | |
---|
391 | self.current_cats = current_cats |
---|
392 | if str(self.current_cats[0]) == 'Uncategorized': |
---|
393 | self.current_cats = [] |
---|
394 | self.parent = parent |
---|
395 | self.selcted_model = title |
---|
396 | vbox = wx.BoxSizer(wx.VERTICAL) |
---|
397 | self.add_sb = wx.StaticBox(self, label = "Add Category") |
---|
398 | self.add_sb_sizer = wx.StaticBoxSizer(self.add_sb, wx.VERTICAL) |
---|
399 | gs = wx.GridSizer(3, 2, 5, 5) |
---|
400 | self.cat_list = cat_list |
---|
401 | |
---|
402 | self.cat_text = wx.StaticText(self, label = "Current categories: ") |
---|
403 | self.current_categories = wx.ListBox(self, |
---|
404 | choices = self.current_cats |
---|
405 | , size=(300, 100)) |
---|
406 | self.existing_check = wx.RadioButton(self, |
---|
407 | label = 'Choose Existing') |
---|
408 | self.new_check = wx.RadioButton(self, label = 'Create new') |
---|
409 | self.exist_combo = wx.ComboBox(self, style = wx.CB_READONLY, |
---|
410 | size=(220,-1), choices = cat_list) |
---|
411 | self.exist_combo.SetSelection(0) |
---|
412 | |
---|
413 | |
---|
414 | self.remove_sb = wx.StaticBox(self, label = "Remove Category") |
---|
415 | |
---|
416 | self.remove_sb_sizer = wx.StaticBoxSizer(self.remove_sb, |
---|
417 | wx.VERTICAL) |
---|
418 | |
---|
419 | self.new_text = wx.TextCtrl(self, size=(220, -1)) |
---|
420 | self.ok_button = wx.Button(self, wx.ID_OK, "Done") |
---|
421 | self.add_button = wx.Button(self, label = "Add") |
---|
422 | self.add_button.Bind(wx.EVT_BUTTON, self.on_add) |
---|
423 | self.remove_button = wx.Button(self, label = "Remove Selected") |
---|
424 | self.remove_button.Bind(wx.EVT_BUTTON, self.on_remove) |
---|
425 | |
---|
426 | self.existing_check.Bind(wx.EVT_RADIOBUTTON, self.on_existing) |
---|
427 | self.new_check.Bind(wx.EVT_RADIOBUTTON, self.on_newcat) |
---|
428 | self.existing_check.SetValue(True) |
---|
429 | |
---|
430 | vbox.Add(self.cat_text, flag = wx.LEFT | wx.TOP | wx.ALIGN_LEFT, |
---|
431 | border = 10) |
---|
432 | vbox.Add(self.current_categories, flag = wx.ALL | wx.EXPAND, |
---|
433 | border = 10 ) |
---|
434 | |
---|
435 | gs.AddMany( [ (self.existing_check, 5, wx.ALL), |
---|
436 | (self.exist_combo, 5, wx.ALL), |
---|
437 | (self.new_check, 5, wx.ALL), |
---|
438 | (self.new_text, 5, wx.ALL ), |
---|
439 | ((-1,-1)), |
---|
440 | (self.add_button, 5, wx.ALL | wx.ALIGN_RIGHT) ] ) |
---|
441 | |
---|
442 | self.add_sb_sizer.Add(gs, proportion = 1, flag = wx.ALL, border = 5) |
---|
443 | vbox.Add(self.add_sb_sizer, flag = wx.ALL | wx.EXPAND, border = 10) |
---|
444 | |
---|
445 | self.remove_sb_sizer.Add(self.remove_button, border = 5, |
---|
446 | flag = wx.ALL | wx.ALIGN_RIGHT) |
---|
447 | vbox.Add(self.remove_sb_sizer, |
---|
448 | flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, |
---|
449 | border = 10) |
---|
450 | vbox.Add(self.ok_button, flag = wx.ALL | wx.ALIGN_RIGHT, |
---|
451 | border = 10) |
---|
452 | |
---|
453 | if self.current_categories.GetCount() > 0: |
---|
454 | self.current_categories.SetSelection(0) |
---|
455 | self.new_text.Disable() |
---|
456 | self.SetSizer(vbox) |
---|
457 | self.Centre() |
---|
458 | self.Show(True) |
---|
459 | if IS_MAC: |
---|
460 | self.ok_button.Bind(wx.EVT_BUTTON, self.on_ok_mac) |
---|
461 | |
---|
462 | def on_ok_mac(self, event): |
---|
463 | """ |
---|
464 | On OK pressed (MAC only) |
---|
465 | """ |
---|
466 | event.Skip() |
---|
467 | self.parent.dial_ok(self, self.selcted_model) |
---|
468 | self.Destroy() |
---|
469 | |
---|
470 | def on_add(self, event): |
---|
471 | """ |
---|
472 | Callback for new category added |
---|
473 | """ |
---|
474 | new_cat = '' |
---|
475 | if self.existing_check.GetValue(): |
---|
476 | new_cat = str(self.exist_combo.GetValue()) |
---|
477 | else: |
---|
478 | new_cat = str(self.new_text.GetValue()) |
---|
479 | if new_cat in self.cat_list: |
---|
480 | wx.MessageBox('%s is already a model' % new_cat, 'Error', |
---|
481 | wx.OK | wx.ICON_EXCLAMATION ) |
---|
482 | return |
---|
483 | |
---|
484 | if new_cat in self.current_cats: |
---|
485 | wx.MessageBox('%s is already included in this model' \ |
---|
486 | % new_cat, 'Error', |
---|
487 | wx.OK | wx.ICON_EXCLAMATION ) |
---|
488 | return |
---|
489 | |
---|
490 | self.current_cats.append(new_cat) |
---|
491 | self.current_categories.SetItems(self.current_cats) |
---|
492 | |
---|
493 | |
---|
494 | def on_remove(self, event): |
---|
495 | """ |
---|
496 | Callback for a category removed |
---|
497 | """ |
---|
498 | if self.current_categories.GetSelection() == wx.NOT_FOUND: |
---|
499 | wx.MessageBox('Please select a category to remove', 'Error', |
---|
500 | wx.OK | wx.ICON_EXCLAMATION ) |
---|
501 | else: |
---|
502 | self.current_categories.Delete( \ |
---|
503 | self.current_categories.GetSelection()) |
---|
504 | self.current_cats = self.current_categories.GetItems() |
---|
505 | |
---|
506 | |
---|
507 | |
---|
508 | def on_newcat(self, event): |
---|
509 | """ |
---|
510 | Callback for new category added |
---|
511 | """ |
---|
512 | self.new_text.Enable() |
---|
513 | self.exist_combo.Disable() |
---|
514 | |
---|
515 | |
---|
516 | def on_existing(self, event): |
---|
517 | """ |
---|
518 | Callback for existing category selected |
---|
519 | """ |
---|
520 | self.new_text.Disable() |
---|
521 | self.exist_combo.Enable() |
---|
522 | |
---|
523 | def get_category(self): |
---|
524 | """ |
---|
525 | Returns a list of categories applying to this model |
---|
526 | """ |
---|
527 | if not self.current_cats: |
---|
528 | self.current_cats.append("Uncategorized") |
---|
529 | |
---|
530 | ret = list() |
---|
531 | for cat in self.current_cats: |
---|
532 | ret.append(str(cat)) |
---|
533 | return ret |
---|
534 | |
---|
535 | if __name__ == '__main__': |
---|
536 | |
---|
537 | |
---|
538 | if(len(sys.argv) > 1): |
---|
539 | app = wx.App() |
---|
540 | CategoryManager(None, -1, 'Category Manager', sys.argv[1]) |
---|
541 | app.MainLoop() |
---|
542 | else: |
---|
543 | app = wx.App() |
---|
544 | CategoryManager(None, -1, 'Category Manager', sys.argv[1]) |
---|
545 | app.MainLoop() |
---|
546 | |
---|