def OnInit(self): self._fullConfigPath = getConfigPath () Application.init(self._fullConfigPath) # Если программа запускается в виде exe-шника, то перенаправить вывод ошибок в лог exepath = unicode (sys.argv[0], getOS().filesEncoding) if exepath.endswith (u".exe"): # Закоментировать следующую строку, если не надо выводить strout/strerr в лог-файл self.RedirectStdio (self.getLogFileName (self._fullConfigPath)) pass from outwiker.gui.mainwindow import MainWindow wx.InitAllImageHandlers() self.mainWnd = MainWindow(None, -1, "") self.SetTopWindow (self.mainWnd) Application.mainWindow = self.mainWnd Application.actionController = ActionController (self.mainWnd, Application.config) registerActions(Application) self.mainWnd.createGui() Application.plugins.load (getPluginsDirList()) self.bindActivateApp() self.Bind (wx.EVT_QUERY_END_SESSION, self._onEndSession) starter = Starter() starter.process() return True
def OnInit(self): getOS().migrateConfig() self._fullConfigPath = getConfigPath() Application.init(self._fullConfigPath) try: starter = Starter() starter.processConsole() except StarterExit: return True redirector = LogRedirector(self.getLogFileName(self._fullConfigPath)) redirector.init() from outwiker.gui.mainwindow import MainWindow self.mainWnd = MainWindow(None, -1, "") self.SetTopWindow(self.mainWnd) Application.mainWindow = self.mainWnd Application.actionController = ActionController( self.mainWnd, Application.config) registerActions(Application) self.mainWnd.createGui() Application.plugins.load(getPluginsDirList()) self.bindActivateApp() self.Bind(wx.EVT_QUERY_END_SESSION, self._onEndSession) starter.processGUI() return True
def OnInit (self): getOS().migrateConfig() self._fullConfigPath = getConfigPath () Application.init(self._fullConfigPath) try: starter = Starter() starter.processConsole() except StarterExit: return True redirector = LogRedirector (self.getLogFileName (self._fullConfigPath)) redirector.init() from outwiker.gui.mainwindow import MainWindow self.mainWnd = MainWindow(None, -1, "") self.SetTopWindow (self.mainWnd) Application.mainWindow = self.mainWnd Application.actionController = ActionController (self.mainWnd, Application.config) registerActions(Application) self.mainWnd.createGui() Application.plugins.load (getPluginsDirList()) self.bindActivateApp() self.Bind (wx.EVT_QUERY_END_SESSION, self._onEndSession) starter.processGUI() return True
def initMainWindow(self): self.mainWnd = MainWindow(self._application) self.SetTopWindow(self.mainWnd) self._application.mainWindow = self.mainWnd self._application.actionController = ActionController( self.mainWnd, self._application.config) registerActions(self._application) self.mainWnd.createGui()
def setUp(self): Application.config.remove_section (MainWindowConfig.MAIN_WINDOW_SECTION) generalConfig = GeneralGuiConfig (Application.config) generalConfig.askBeforeExit.value = False self.wnd = MainWindow (None, -1, "") Application.mainWindow = self.wnd Application.actionController = ActionController (self.wnd, Application.config) wx.GetApp().SetTopWindow (self.wnd) registerActions (Application) self.wnd.createGui()
def OnInit(self): getOS().init() getOS().migrateConfig() self._fullConfigPath = getConfigPath() Application.init(self._fullConfigPath) self._locale = wx.Locale(wx.LANGUAGE_DEFAULT) try: starter = Starter() starter.processConsole() except StarterExit: return True if APP_DATA_DEBUG not in Application.sharedData: config = GeneralGuiConfig(Application.config) Application.sharedData[APP_DATA_DEBUG] = config.debug.value level = (logging.DEBUG if Application.sharedData.get(APP_DATA_DEBUG, False) else logging.WARNING) redirector = LogRedirector(self.getLogFileName(self._fullConfigPath), level) redirector.init() wx.Log.SetLogLevel(0) logger = logging.getLogger('outwiker') for n, dirname in enumerate(getSpecialDirList(u'')): logger.info(u'Special directory [{}]: {}'.format(n, dirname)) from outwiker.gui.mainwindow import MainWindow self.mainWnd = MainWindow(None, -1, "") self.SetTopWindow(self.mainWnd) Application.mainWindow = self.mainWnd Application.actionController = ActionController(self.mainWnd, Application.config) registerActions(Application) self.mainWnd.createGui() Application.plugins.load(getPluginsDirList()) self.bindActivateApp() self.Bind(wx.EVT_QUERY_END_SESSION, self._onEndSession) starter.processGUI() return True
def OnInit(self): getOS().init() getOS().migrateConfig() self._fullConfigPath = getConfigPath() Application.init(self._fullConfigPath) self._locale = wx.Locale(wx.LANGUAGE_DEFAULT) try: starter = Starter() starter.processConsole() except StarterExit: return True if APP_DATA_DEBUG not in Application.sharedData: config = GeneralGuiConfig(Application.config) Application.sharedData[APP_DATA_DEBUG] = config.debug.value level = (logging.INFO if Application.sharedData.get(APP_DATA_DEBUG, False) else logging.WARNING) redirector = LogRedirector(self.getLogFileName(self._fullConfigPath), level) redirector.init() wx.Log.SetLogLevel(0) from outwiker.gui.mainwindow import MainWindow self.mainWnd = MainWindow(None, -1, "") self.SetTopWindow(self.mainWnd) Application.mainWindow = self.mainWnd Application.actionController = ActionController(self.mainWnd, Application.config) registerActions(Application) self.mainWnd.createGui() Application.plugins.load(getPluginsDirList()) self.bindActivateApp() self.Bind(wx.EVT_QUERY_END_SESSION, self._onEndSession) starter.processGUI() return True
def setUp(self): self.path = mkdtemp (prefix=u'OutWiker_Абырвалг абырвалг_' + unicode (self.__class__.__name__, 'utf-8')) Application.config.remove_section (MainWindowConfig.MAIN_WINDOW_SECTION) generalConfig = GeneralGuiConfig (Application.config) generalConfig.askBeforeExit.value = False self.wnd = MainWindow (None, -1, "") Application.mainWindow = self.wnd Application.actionController = ActionController (self.wnd, Application.config) wx.GetApp().SetTopWindow (self.wnd) registerActions (Application) self.wnd.createGui() self.wikiroot = WikiDocument.create (self.path) Tester.dialogTester.clear() Application.wikiroot = None
def setUp(self): self.path = mkdtemp(prefix=u'OutWiker_Абырвалг абырвалг_' + unicode(self.__class__.__name__, 'utf-8')) Application.config.remove_section(MainWindowConfig.MAIN_WINDOW_SECTION) generalConfig = GeneralGuiConfig(Application.config) generalConfig.askBeforeExit.value = False self.wnd = MainWindow(None, -1, "") Application.mainWindow = self.wnd Application.actionController = ActionController( self.wnd, Application.config) wx.GetApp().SetTopWindow(self.wnd) registerActions(Application) self.wnd.createGui() self.wikiroot = WikiDocument.create(self.path) Tester.dialogTester.clear() Application.wikiroot = None
def OnInit (self): getOS().migrateConfig() self._fullConfigPath = getConfigPath () Application.init(self._fullConfigPath) try: starter = Starter() starter.processConsole() except StarterExit: return True # Если программа запускается в виде exe-шника, то перенаправить вывод ошибок в лог if getExeFile().endswith (u".exe"): # Закоментировать следующую строку, если не надо выводить strout/strerr в лог-файл self.RedirectStdio (self.getLogFileName (self._fullConfigPath)) pass from outwiker.gui.mainwindow import MainWindow self.mainWnd = MainWindow(None, -1, "") self.SetTopWindow (self.mainWnd) Application.mainWindow = self.mainWnd Application.actionController = ActionController (self.mainWnd, Application.config) registerActions(Application) self.mainWnd.createGui() Application.plugins.load (getPluginsDirList()) self.bindActivateApp() self.Bind (wx.EVT_QUERY_END_SESSION, self._onEndSession) starter.processGUI() return True