本文整理汇总了Python中cola.widgets.browse.BrowseDialog.select_file_from_list方法的典型用法代码示例。如果您正苦于以下问题:Python BrowseDialog.select_file_from_list方法的具体用法?Python BrowseDialog.select_file_from_list怎么用?Python BrowseDialog.select_file_from_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cola.widgets.browse.BrowseDialog
的用法示例。
在下文中一共展示了BrowseDialog.select_file_from_list方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: diff_branch
# 需要导入模块: from cola.widgets.browse import BrowseDialog [as 别名]
# 或者: from cola.widgets.browse.BrowseDialog import select_file_from_list [as 别名]
def diff_branch():
"""Launches a diff against a branch."""
branch = choose_from_combo('Select Branch, Tag, or Commit-ish',
['HEAD^'] +
cola.model().all_branches() +
cola.model().tags)
if not branch:
return
zfiles_str = git.instance().diff(branch, name_only=True,
no_color=True,
z=True).rstrip('\0')
files = [core.decode(f) for f in zfiles_str.split('\0')]
filename = BrowseDialog.select_file_from_list(files)
if not filename:
return
cola.notifier().broadcast(signals.branch_mode, branch, filename)
示例2: diff_branch
# 需要导入模块: from cola.widgets.browse import BrowseDialog [as 别名]
# 或者: from cola.widgets.browse.BrowseDialog import select_file_from_list [as 别名]
def diff_branch():
"""Launches a diff against a branch."""
branch = choose_from_combo('Select Branch, Tag, or Commit-ish',
['HEAD^'] +
cola.model().all_branches() +
cola.model().tags)
if not branch:
return
files = gitcmds.diff_filenames(branch)
if not files:
qtutils.critical('No Differences',
'No differences found for "%s"' % branch)
return
filename = BrowseDialog.select_file_from_list(files)
if not filename:
return
cola.notifier().broadcast(signals.branch_mode, branch, filename)