本文整理汇总了Python中GitGutter.view_collection.ViewCollection.get_key方法的典型用法代码示例。如果您正苦于以下问题:Python ViewCollection.get_key方法的具体用法?Python ViewCollection.get_key怎么用?Python ViewCollection.get_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitGutter.view_collection.ViewCollection
的用法示例。
在下文中一共展示了ViewCollection.get_key方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def run(self):
self.view = self.window.active_view()
key = ViewCollection.get_key(self.view)
self.handler = ViewCollection.views[key]
self.results = self.commit_list()
if self.results:
self.window.show_quick_panel(self.results, self.on_select)
示例2: add
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def add(view):
key = ViewCollection.get_key(view)
try:
from GitGutter.git_gutter_handler import GitGutterHandler
except ImportError:
from git_gutter_handler import GitGutterHandler
handler = ViewCollection.views[key] = GitGutterHandler(view)
handler.reset()
return handler
示例3: buf_tmp_file
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def buf_tmp_file(view):
key = ViewCollection.get_key(view)
if not key in ViewCollection.buf_files:
ViewCollection.buf_files[key] = tempfile.NamedTemporaryFile()
ViewCollection.buf_files[key].close()
return ViewCollection.buf_files[key]
示例4: update_git_time
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def update_git_time(view):
key = ViewCollection.get_key(view)
ViewCollection.git_times[key] = time.time()
示例5: clear_git_time
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def clear_git_time(view):
key = ViewCollection.get_key(view)
ViewCollection.git_times[key] = 0
示例6: git_time
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def git_time(view):
key = ViewCollection.get_key(view)
if not key in ViewCollection.git_times:
ViewCollection.git_times[key] = 0
return time.time() - ViewCollection.git_times[key]
示例7: total_lines
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def total_lines(view):
key = ViewCollection.get_key(view)
return ViewCollection.views[key].total_lines()
示例8: ignored
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def ignored(view):
key = ViewCollection.get_key(view)
return ViewCollection.views[key].ignored()
示例9: untracked
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def untracked(view):
key = ViewCollection.get_key(view)
return ViewCollection.views[key].untracked()
示例10: diff
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def diff(view):
key = ViewCollection.get_key(view)
return ViewCollection.views[key].diff()
示例11: get_handler
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def get_handler(view):
if ViewCollection.has_view(view):
key = ViewCollection.get_key(view)
return ViewCollection.views[key]
else:
return ViewCollection.add(view)
示例12: has_view
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def has_view(view):
key = ViewCollection.get_key(view)
return key in ViewCollection.views
示例13: git_path
# 需要导入模块: from GitGutter.view_collection import ViewCollection [as 别名]
# 或者: from GitGutter.view_collection.ViewCollection import get_key [as 别名]
def git_path(view):
key = ViewCollection.get_key(view)
if key in ViewCollection.views:
return ViewCollection.views[key].get_git_path()
else:
return False