Beispiel #1
0
 def OnDatasourceAddMenu(self, event):
     """Called on 'Datasource'->'Add...' menu.
     """
     debug('Available datasource page types: %s' %DATASOURCE_PAGE_REGISTRY.keys())
     dlg = AddDatasourceDialog(self.browser, choices=sorted(DATASOURCE_PAGE_REGISTRY.keys()))
     if dlg.ShowModal()==wx.ID_OK:
         label_name = dlg.label_name
         page_class = DATASOURCE_PAGE_REGISTRY.get(dlg.datasource_name, None)
         debug('Got %s as %s' %(page_class.__name__, label_name))
         if page_class is None:
             wx.MessageBox('Page Type not found: %s' %dlg.datasource_name, 'Error')
         # load new dialog page
         self.datasource_panel.notebook.create_page(page_class, label_name)
     dlg.Destroy()
Beispiel #2
0
 def post_init_setup(self):
     """The last phase of initialization.
     """
     # load datasources
     ds_registry = self.registry.load_section('datasources')
     for label_name, ds_name, ds_info in ds_registry.get('pages', []):
         page_class = DATASOURCE_PAGE_REGISTRY.get(ds_name, None)
         if page_class is None:
             wx.MessageBox('Page Type not found: %s' %ds_name, 'Error')
         idx, page = self.datasource_panel.notebook.create_page(page_class, label_name)
         page.restore(ds_info)
     # load pipeline
     pl_registry = self.registry.load_section('pipeline')
     tree_info = pl_registry.get('tree', None)
     if tree_info:
         self.pipeline.restore(tree_info)
         self.pipeline_tree_ctrl.rebuild_root()
         self.pipeline_tree_ctrl.ExpandAll()
Beispiel #3
0
 def OnDatasourceAddMenu(self, event):
     """Called on 'Datasource'->'Add...' menu.
     """
     debug('Available datasource page types: %s' %
           DATASOURCE_PAGE_REGISTRY.keys())
     dlg = AddDatasourceDialog(self.browser,
                               choices=sorted(
                                   DATASOURCE_PAGE_REGISTRY.keys()))
     if dlg.ShowModal() == wx.ID_OK:
         label_name = dlg.label_name
         page_class = DATASOURCE_PAGE_REGISTRY.get(dlg.datasource_name,
                                                   None)
         debug('Got %s as %s' % (page_class.__name__, label_name))
         if page_class is None:
             wx.MessageBox('Page Type not found: %s' % dlg.datasource_name,
                           'Error')
         # load new dialog page
         self.datasource_panel.notebook.create_page(page_class, label_name)
     dlg.Destroy()
Beispiel #4
0
 def post_init_setup(self):
     """The last phase of initialization.
     """
     # load datasources
     ds_registry = self.registry.load_section('datasources')
     for label_name, ds_name, ds_info in ds_registry.get('pages', []):
         page_class = DATASOURCE_PAGE_REGISTRY.get(ds_name, None)
         if page_class is None:
             wx.MessageBox('Page Type not found: %s' % ds_name, 'Error')
         idx, page = self.datasource_panel.notebook.create_page(
             page_class, label_name)
         page.restore(ds_info)
     # load pipeline
     pl_registry = self.registry.load_section('pipeline')
     tree_info = pl_registry.get('tree', None)
     if tree_info:
         self.pipeline.restore(tree_info)
         self.pipeline_tree_ctrl.rebuild_root()
         self.pipeline_tree_ctrl.ExpandAll()