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


Python Utils.Object类代码示例

本文整理汇总了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)
开发者ID:naholyr,项目名称:sublime-text-2__config,代码行数:25,代码来源:SideBarGitCommands.py

示例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)
开发者ID:yarmand,项目名称:my_sublime_text_2,代码行数:8,代码来源:SideBarGitCommands.py

示例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)
开发者ID:naholyr,项目名称:sublime-text-2__config,代码行数:12,代码来源:SideBarGitCommands.py

示例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
开发者ID:naholyr,项目名称:sublime-text-2__config,代码行数:57,代码来源:SideBarItem.py


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