本文整理汇总了Python中editxt.application.Application.save_window_settings方法的典型用法代码示例。如果您正苦于以下问题:Python Application.save_window_settings方法的具体用法?Python Application.save_window_settings怎么用?Python Application.save_window_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类editxt.application.Application
的用法示例。
在下文中一共展示了Application.save_window_settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_window_settings_with_unknown_editor
# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import save_window_settings [as 别名]
def test_save_window_settings_with_unknown_editor():
ac = Application()
m = Mocker()
df_class = m.replace("editxt.application.NSUserDefaults")
ed = m.mock(Editor)
with m:
ac.save_window_settings(ed)
示例2: do_save_window_settings
# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import save_window_settings [as 别名]
def do_save_window_settings(ed_count, close_ed, wsets, default_settings, all_settings):
m = Mocker()
ac = Application()
df_class = m.replace("editxt.application.NSUserDefaults")
defaults = MockUserDefaults()
defaults.setObject_forKey_(default_settings, const.WINDOW_SETTINGS_DEFAULTS_KEY)
ac.editors = eds = [m.mock(Editor) for x in xrange(ed_count)]
if close_ed < 6:
df_class.standardUserDefaults() >> defaults
eds[close_ed-1].window_settings >> wsets
with m:
ac.save_window_settings(eds[close_ed-1])
saved = defaults.arrayForKey_(const.WINDOW_SETTINGS_DEFAULTS_KEY)
eq_(saved, all_settings)