def __init__(self, app=None, doc=None, tmppath=None): TestAppBase.__init__(self) make_gui = self.make_gui link_gui = self.link_gui self._tmppath = tmppath if app is None: app = Application(self.make_logger(ApplicationGUI)) self.app = app self.app_gui = app.view if doc is None: doc = Document(self.app) doc.view = self.make_logger(DocumentGUI) self.doc = doc self.doc_gui = doc.view self.mainwindow = MainWindow(self.doc) # we set mainwindow's view at the end because it triggers daterangeselector refreshes # which needs to have its own view set first. # XXX The way our GUI instances are created in TestApp is incompatible with the lazy view # creation path that moneyGuru is engaged in. Changing all tests is way too big a task, # but we can at least make new tests comply with lazy view creation. Ideally, all these # "nwview", "ttable" and others wouldn't exist in TestApp, we'd get a view instance by the # return value of TestApp.show_*view() and access its child GUI objects through that # reference. self.mw = self.mainwindow # shortcut. This one is often typed self.default_parent = self.mw self.apanel = link_gui(self.mw.account_panel) self.scpanel = link_gui(self.mw.schedule_panel) self.scsplittable = link_gui(self.scpanel.split_table) self.tpanel = link_gui(self.mw.transaction_panel) self.stable = link_gui(self.tpanel.split_table) self.mepanel = link_gui(self.mw.mass_edit_panel) self.bpanel = link_gui(self.mw.budget_panel) self.cdrpanel = link_gui(self.mw.custom_daterange_panel) self.arpanel = link_gui(self.mw.account_reassign_panel) self.expanel = link_gui(self.mw.export_panel) self.sfield = link_gui(self.mw.search_field) self.drsel = link_gui(self.mw.daterange_selector) make_gui('csvopt', CSVOptions, parent=self.doc) iwin = ImportWindow(self.doc) # We have to link the import table's gui before we link iwin's # The order in which the gui is linked in linked_gui causes a crash in pref_test. # import_table.columns has to be linked first. link_gui(iwin.import_table.columns) self.itable = link_gui(iwin.import_table) self.iwin = link_gui(iwin) self.alookup = link_gui(self.mw.account_lookup) self.clookup = link_gui(self.mw.completion_lookup) self.doc.connect() self.mw.view = self.make_logger(MainWindowGUI, self) self.mainwindow_gui = self.mw.view self.mw.connect()
def __init__(self, app=None, doc=None, tmppath=None, appargs=None): TestAppBase.__init__(self) self.panel_view_provider = PanelViewProvider() link_gui = self.link_gui self._tmppath = tmppath if app is None: if not appargs: appargs = {} app = Application(self.make_logger(ApplicationGUI()), **appargs) self.app = app self.app_gui = app.view if doc is None: doc = Document(self.app) doc.view = self.make_logger(DocumentGUI()) self.doc = doc self.doc_gui = doc.view self.mainwindow = MainWindow(self.doc) # we set mainwindow's view at the end because it triggers daterangeselector refreshes # which needs to have its own view set first. # XXX The way our GUI instances are created in TestApp is incompatible with the lazy view # creation path that moneyGuru is engaged in. Changing all tests is way too big a task, # but we can at least make new tests comply with lazy view creation. Ideally, all these # "nwview", "ttable" and others wouldn't exist in TestApp, we'd get a view instance by the # return value of TestApp.show_*view() and access its child GUI objects through that # reference. self.mw = self.mainwindow # shortcut. This one is often typed self.default_parent = self.mw self.sfield = link_gui(self.mw.search_field) self.drsel = link_gui(self.mw.daterange_selector) self.csvopt = link_gui(self.mw.csv_options) # We have to link the import table's gui before we link iwin's # The order in which the gui is linked in linked_gui causes a crash in pref_test. # import_table.columns has to be linked first. link_gui(self.mw.import_window.import_table.columns) self.itable = link_gui(self.mw.import_window.import_table) self.iwin = link_gui(self.mw.import_window) self.alookup = link_gui(self.mw.account_lookup) self.clookup = link_gui(self.mw.completion_lookup) self.doc.connect() self.mw.view = self.make_logger(MainWindowGUI(self)) self.mainwindow_gui = self.mw.view self.mw.connect()
def __init__(self): def link_gui(gui): gui.view = self.make_logger() if hasattr(gui, "columns"): # tables gui.columns.view = self.make_logger() return gui TestAppBase.__init__(self) self.app = DupeGuru() self.default_parent = self.app self.dtree = link_gui(self.app.directory_tree) self.dpanel = link_gui(self.app.details_panel) self.slabel = link_gui(self.app.stats_label) self.pdialog = PrioritizeDialog(self.app) link_gui(self.pdialog.category_list) link_gui(self.pdialog.criteria_list) link_gui(self.pdialog.prioritization_list) link_gui(self.app.ignore_list_dialog) link_gui(self.app.ignore_list_dialog.ignore_list_table) link_gui(self.app.progress_window) link_gui(self.app.progress_window.jobdesc_textfield) link_gui(self.app.progress_window.progressdesc_textfield)
def __init__(self): def link_gui(gui): gui.view = self.make_logger() if hasattr(gui, 'columns'): # tables gui.columns.view = self.make_logger() return gui TestAppBase.__init__(self) self.app = DupeGuru() self.default_parent = self.app self.dtree = link_gui(self.app.directory_tree) self.dpanel = link_gui(self.app.details_panel) self.slabel = link_gui(self.app.stats_label) self.pdialog = PrioritizeDialog(self.app) link_gui(self.pdialog.category_list) link_gui(self.pdialog.criteria_list) link_gui(self.pdialog.prioritization_list) link_gui(self.app.ignore_list_dialog) link_gui(self.app.ignore_list_dialog.ignore_list_table) link_gui(self.app.progress_window) link_gui(self.app.progress_window.jobdesc_textfield) link_gui(self.app.progress_window.progressdesc_textfield)