本文整理汇总了Python中gi.repository.Gedit.commands_save_all_documents方法的典型用法代码示例。如果您正苦于以下问题:Python Gedit.commands_save_all_documents方法的具体用法?Python Gedit.commands_save_all_documents怎么用?Python Gedit.commands_save_all_documents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gi.repository.Gedit
的用法示例。
在下文中一共展示了Gedit.commands_save_all_documents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from gi.repository import Gedit [as 别名]
# 或者: from gi.repository.Gedit import commands_save_all_documents [as 别名]
def __init__(self, window, panel, all_docs, node):
self._window = window
self._panel = panel
self._node = node
self._error = False
self._signal_ids = {}
self._counter = 0
if all_docs:
docs = window.get_documents()
else:
docs = [window.get_active_document()]
docs_to_save = [doc for doc in docs if doc.get_modified()]
signals = {}
for doc in docs_to_save:
signals[doc] = doc.connect('saving', self.on_document_saving)
if len(docs_to_save) == len(docs) and len(docs) != 0:
Gedit.commands_save_all_documents(window)
else:
for doc in docs_to_save:
Gedit.commands_save_document(window, doc)
for doc in docs_to_save:
doc.disconnect(signals[doc])
self.run_tool()
示例2: save_all
# 需要导入模块: from gi.repository import Gedit [as 别名]
# 或者: from gi.repository.Gedit import commands_save_all_documents [as 别名]
def save_all(view):
window = view.get_toplevel()
Gedit.commands_save_all_documents(window)
return commander.commands.result.HIDE