本文整理汇总了Python中editxt.application.Application.application_will_finish_launching方法的典型用法代码示例。如果您正苦于以下问题:Python Application.application_will_finish_launching方法的具体用法?Python Application.application_will_finish_launching怎么用?Python Application.application_will_finish_launching使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类editxt.application.Application
的用法示例。
在下文中一共展示了Application.application_will_finish_launching方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import application_will_finish_launching [as 别名]
def test(eds_config):
app = Application()
m = Mocker()
create_window = m.method(app.create_window)
open_error_log = m.method(app.open_error_log)
nsapp = m.mock(ak.NSApplication)
ud_class = m.replace(fn, 'NSUserDefaults')
m.method(app.iter_saved_window_states)() >> iter(eds_config)
tc = m.replace(app, 'text_commander', spec=CommandManager)
dc = m.mock(DocumentController)
tc.load_commands(dc.textMenu >> m.mock(ak.NSMenu))
tc.load_shortcuts(dc.shortcutsMenu >> m.mock(ak.NSMenu))
if eds_config:
error = False
for ed_config in eds_config:
if isinstance(ed_config, mod.StateLoadFailure):
error = True
else:
create_window(ed_config)
if error:
open_error_log(set_current=False)
else:
create_window()
with m:
app.application_will_finish_launching(nsapp, dc)
eq_(app.text_commander, tc)
示例2: test
# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import application_will_finish_launching [as 别名]
def test(eds_config):
app = Application()
m = Mocker()
create_editor = m.method(app.create_editor)
nsapp = m.mock(ak.NSApplication)
ud_class = m.replace(fn, 'NSUserDefaults')
m.method(app.iter_saved_editor_states)() >> iter(eds_config)
tc = m.replace(app, 'text_commander', spec=TextCommandController)
dc = m.mock(DocumentController)
menu = dc.textMenu >> m.mock(ak.NSMenu)
m.method(app.init_syntax_definitions)()
tc.load_commands(menu)
if eds_config:
for ed_config in eds_config:
create_editor(ed_config)
else:
create_editor()
with m:
app.application_will_finish_launching(nsapp, dc)
eq_(app.text_commander, tc)
示例3: test
# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import application_will_finish_launching [as 别名]
def test(eds_config):
app = Application()
m = Mocker()
create_editor = m.method(app.create_editor)
nsapp = m.mock(NSApplication)
ud_class = m.replace("editxt.application.NSUserDefaults")
ud = ud_class.standardUserDefaults() >> m.mock(NSUserDefaults)
ud.arrayForKey_(const.WINDOW_CONTROLLERS_DEFAULTS_KEY) >> eds_config
cmd_class = m.replace("editxt.textcommand.TextCommandController")
dc = m.mock(DocumentController)
menu = dc.textMenu >> m.mock(NSMenu)
m.method(app.init_syntax_definitions)()
tc = cmd_class(menu) >> m.mock(TextCommandController)
tc.load_commands()
if eds_config:
for ed_config in eds_config:
create_editor(ed_config)
else:
create_editor()
with m:
app.application_will_finish_launching(nsapp, dc)
eq_(app.text_commander, tc)