本文整理汇总了Python中Utils.Object类的典型用法代码示例。如果您正苦于以下问题:Python Object类的具体用法?Python Object怎么用?Python Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Object类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
def run(self, paths = [], input = False, content = ''):
if input == False:
SideBarGit().prompt('Enter a commit message: ', '', self.run, paths)
elif content != '':
import sys
content = (content[0].upper() + content[1:]).encode(sys.getfilesystemencoding())
for repo in SideBarGit().getSelectedRepos(SideBarSelection(paths).getSelectedItems()):
commitCommandAdd = ['git', 'add', '--']
commitCommandCommit = ['git', 'commit', '-m', content, '--']
for item in repo.items:
commitCommandAdd.append(item.forCwdSystemPathRelativeFromRecursive(repo.repository.path()))
commitCommandCommit.append(item.forCwdSystemPathRelativeFrom(repo.repository.path()))
object = Object()
object.item = repo.repository
object.command = commitCommandAdd
SideBarGit().run(object)
object = Object()
object.item = repo.repository
object.to_status_bar = True
object.command = commitCommandCommit
SideBarGit().run(object)
object = Object()
object.item = repo.repository
object.command = ['git','push']
SideBarGit().run(object, True)
示例2: run
def run(self, paths = []):
for item in SideBarSelection(paths).getSelectedItems():
object = Object()
object.item = item
object.command = ['git', 'reflog', '--no-color', '--', item.forCwdSystemName()]
object.title = 'Reflog: '+item.name()
object.syntax_file = 'Packages/Git/Git Graph.tmLanguage'
SideBarGit().run(object)
示例3: on_done
def on_done(self, extra, data, result):
result = data[result].strip()
if result.startswith("*"):
return
else:
import sys
branch = result.split(' ')[0]
object = Object()
object.item = extra
object.command = ['git', 'branch', '-d', branch.encode(sys.getfilesystemencoding())]
object.to_status_bar = True
SideBarGit().run(object)
示例4: _move_moveView
def _move_moveView(self, window, view, location, active_view):
if active_view == view:
is_active_view = True
else:
is_active_view = False
options = Object()
options.scroll = view.viewport_position()
options.selections = []
for sel in view.sel():
line_s, col_s = view.rowcol(sel.a)
line_e, col_e = view.rowcol(sel.b)
options.selections.append([view.text_point(line_s, col_s), view.text_point(line_e, col_e)])
options.marks = []
for sel in view.get_regions("mark"):
line_s, col_s = view.rowcol(sel.a)
line_e, col_e = view.rowcol(sel.b)
options.marks.append([view.text_point(line_s, col_s), view.text_point(line_e, col_e)])
options.bookmarks = []
for sel in view.get_regions("bookmarks"):
line_s, col_s = view.rowcol(sel.a)
line_e, col_e = view.rowcol(sel.b)
options.bookmarks.append([view.text_point(line_s, col_s), view.text_point(line_e, col_e)])
options.folds = []
if int(sublime.version()) >= 2167:
for sel in view.folded_regions():
line_s, col_s = view.rowcol(sel.a)
line_e, col_e = view.rowcol(sel.b)
options.folds.append([view.text_point(line_s, col_s), view.text_point(line_e, col_e)])
else:
for sel in view.unfold(sublime.Region(0, view.size())):
line_s, col_s = view.rowcol(sel.a)
line_e, col_e = view.rowcol(sel.b)
options.folds.append([view.text_point(line_s, col_s), view.text_point(line_e, col_e)])
window.focus_view(view)
if view.is_dirty():
options.content = view.substr(sublime.Region(0, view.size()))
view.window().run_command("revert")
else:
options.content = False
window.run_command("close")
view = window.open_file(location)
sublime.set_timeout(lambda: self._move_restoreView(view, options), 200)
if is_active_view:
window.focus_view(view)
return view
else:
window.focus_view(active_view)
return active_view