def setUp(self): #rows = sys.path #for row in rows: # print row cfg = ConfigReader() cfg.read("../config.xml") Database.Open(cfg.GetPath(), cfg.GetUsername(), cfg.GetPassword())
def OnInit(self): if os.name == 'posix': print os.environ['PWD'] cfg = ConfigReader() cfg.read("../main/config.xml") Database.Open(cfg.GetPath(), cfg.GetUsername(), cfg.GetPassword()) frame = MainFrame(None, title="The Main Frame") self.SetTopWindow(frame) frame.Show(True) return True
appName = wx.GetApp().GetAppName() assert appName, "No App Name Set" config = wx.Config(appName) perspective = config.Read("perspective") if perspective: self._mgr.LoadPerspective(perspective) def Quit(self): self._mgr.UnInit() self.Destroy() class IAPanel(wx.Panel): def __init__(self, *args, **keys): wx.Panel.__init__(self, *args, **keys) self.test1 = wx.TextCtrl(self, wx.ID_ANY, 'Pane 1 - simple text') if __name__ == "__main__": #str=os.path.curdir #new if os.name == 'posix': print os.environ['PWD'] print platform.system() cfg = ConfigReader() cfg.read("config.xml") Database.Open(cfg.GetPath(), cfg.GetUsername(), cfg.GetPassword()) # end new app = MyApp(False) app.MainLoop()
sizer.Add(btnSizer) self.SetSizer(sizer) self.SetInitialSize() def OnOpenDlg(self, event): wizard = NewWizard(self) wizard.Create() wizard.Run() class PatentEditPanel(wx.Panel): def __init__(self, parent): super(PatentEditPanel, self).__init__(parent, style=wx.LB_BOTTOM) class TestApp(wx.App): def OnInit(self): patentEditDialog = PatentEditDialog() patentEditDialog.ShowModal() return True from access.database import Database from utils.configreader import ConfigReader if __name__ == "__main__": cfg = ConfigReader() cfg.read("/home/wzw7yn/workspace/pms/main/config.xml") Database.Open(cfg.GetPath(), cfg.GetUsername(), cfg.GetPassword()) app = TestApp(False) app.MainLoop()