本文整理汇总了Python中outwiker.core.application.Application.init方法的典型用法代码示例。如果您正苦于以下问题:Python Application.init方法的具体用法?Python Application.init怎么用?Python Application.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类outwiker.core.application.Application
的用法示例。
在下文中一共展示了Application.init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OnInit
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import init [as 别名]
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
示例2: OnInit
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import init [as 别名]
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
示例3: OnInit
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import init [as 别名]
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
示例4: OnInit
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import init [as 别名]
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
示例5: emptyFunc
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import init [as 别名]
import wxversion
try:
wxversion.select(WX_VERSION)
except wxversion.VersionError:
if os.name == "nt":
pass
else:
raise
import wx
if __name__ == '__main__':
from outwiker.core.application import Application
Application.init("../test/testconfig.ini")
app = wx.App(redirect=False)
def emptyFunc():
pass
app.bindActivateApp = emptyFunc
app.unbindActivateApp = emptyFunc
loop = wx.EventLoop()
wx.EventLoop.SetActive(loop)
wx.Log.SetLogLevel(0)
import unittest
from test.plugins.sessions.test_loading import SessionsLoadingTest
示例6: outwikerProfile
# 需要导入模块: from outwiker.core.application import Application [as 别名]
# 或者: from outwiker.core.application.Application import init [as 别名]
#pparser.run()
cProfile.run('pparser.run()', profile_fname)
stats = pstats.Stats(profile_fname)
stats.strip_dirs().sort_stats('time').print_stats(30)
def outwikerProfile ():
global outwiker
outwiker = OutWiker(0)
profile_fname = "../profiles/outwiker.profile"
cProfile.run('outwiker.MainLoop()', profile_fname)
stats = pstats.Stats(profile_fname)
#stats.strip_dirs().sort_stats('calls').print_stats(30)
stats.strip_dirs().sort_stats('time').print_stats(100)
if __name__ == "__main__":
Application.init ("../profiles/testconfig.ini")
class testApp(wx.App):
def __init__(self, *args, **kwds):
wx.App.__init__ (self, *args, **kwds)
app = testApp(redirect=False)
wikiparserProfile()
# outwikerProfile ()