当前位置: 首页>>代码示例>>Python>>正文


Python Application.open_documents_with_paths方法代码示例

本文整理汇总了Python中editxt.application.Application.open_documents_with_paths方法的典型用法代码示例。如果您正苦于以下问题:Python Application.open_documents_with_paths方法的具体用法?Python Application.open_documents_with_paths怎么用?Python Application.open_documents_with_paths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在editxt.application.Application的用法示例。


在下文中一共展示了Application.open_documents_with_paths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test

# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import open_documents_with_paths [as 别名]
 def test(c):
     m = Mocker()
     app = Application()
     create_window = m.method(app.create_window)
     window = m.mock(Window)
     m.method(app.current_window)() >> (window if c.has_window else None)
     if not c.has_window:
         create_window() >> window
     items = window.open_paths("<paths>") >> m.mock()
     with m:
         app.open_documents_with_paths("<paths>")
开发者ID:editxt,项目名称:editxt,代码行数:13,代码来源:test_application.py

示例2: test

# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import open_documents_with_paths [as 别名]
 def test(c):
     m = Mocker()
     app = Application()
     exists = lambda path: True
     alog = m.replace(mod, 'log')
     ed = m.mock(Editor)
     dv_class = m.replace(edoc, 'TextDocumentView')
     m.method(app.current_editor)() >> (ed if c.has_editor else None)
     if not c.has_editor:
         m.method(app.create_editor)() >> ed
     focus = None
     for p in c.paths:
         exists(p.path) >> p.exists
         dv = dv_class.create_with_path(p.path) >> m.mock(TextDocumentView)
         focus = ed.add_document_view(dv) >> dv
     if focus is not None:
         ed.current_view = dv
     with replattr(os.path, 'isfile', exists), m:
         app.open_documents_with_paths([p.path for p in c.paths])
开发者ID:khairy,项目名称:editxt,代码行数:21,代码来源:test_application.py

示例3: test

# 需要导入模块: from editxt.application import Application [as 别名]
# 或者: from editxt.application.Application import open_documents_with_paths [as 别名]
 def test(c):
     m = Mocker()
     app = Application()
     exists = m.replace("os.path.isfile")
     alog = m.replace("editxt.application.log", passthrough=False)
     ed = m.mock(Editor)
     dv_class = m.replace(TextDocumentView, passthrough=False)
     m.method(app.current_editor)() >> (ed if c.has_editor else None)
     if not c.has_editor:
         m.method(app.create_editor)() >> ed
     focus = None
     for p in c.paths:
         exists(p.path) >> p.exists
         dv = dv_class.create_with_path(p.path) >> m.mock(TextDocumentView)
         focus = ed.add_document_view(dv) >> dv
     if focus is not None:
         ed.current_view = dv
     with m:
         app.open_documents_with_paths([p.path for p in c.paths])
开发者ID:youngrok,项目名称:editxt,代码行数:21,代码来源:test_application.py


注:本文中的editxt.application.Application.open_documents_with_paths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。