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


Python Object.no_results方法代码示例

本文整理汇总了Python中Utils.Object.no_results方法的典型用法代码示例。如果您正苦于以下问题:Python Object.no_results方法的具体用法?Python Object.no_results怎么用?Python Object.no_results使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils.Object的用法示例。


在下文中一共展示了Object.no_results方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from Utils import Object [as 别名]
# 或者: from Utils.Object import no_results [as 别名]
	def run(self, paths = []):
		for item in SideBarSelection(paths).getSelectedItems():
			object = Object()
			object.item = item
			object.command = ['git', 'log', '--stat', '--graph', '--decorate', '--no-color', '--', item.forCwdSystemName()]
			object.title = 'Log: '+item.name()
			object.no_results = 'No log to show'
			SideBarGit().run(object)
开发者ID:naholyr,项目名称:sublime-text-2__config,代码行数:10,代码来源:SideBarGitCommands.py

示例2: run

# 需要导入模块: from Utils import Object [as 别名]
# 或者: from Utils.Object import no_results [as 别名]
	def run(self, paths = []):
		for item in SideBarSelection(paths).getSelectedItems():
			object = Object()
			object.item = item
			object.command = ['git', 'log', '--pretty=short', '--decorate', '--graph', '--no-color', '--', item.forCwdSystemName()]
			object.title = 'Log: '+item.name()
			object.no_results = 'No log to show'
			object.syntax_file = 'Packages/Git/Git Graph.tmLanguage'
			SideBarGit().run(object)
开发者ID:yarmand,项目名称:my_sublime_text_2,代码行数:11,代码来源:SideBarGitCommands.py

示例3: run

# 需要导入模块: from Utils import Object [as 别名]
# 或者: from Utils.Object import no_results [as 别名]
	def run(
					self,
					object,
					modal = False,
					background = False,
					
					refresh_funct_view = False,
					refresh_funct_command = False,
					refresh_funct_item = False,
					refresh_funct_to_status_bar = False,
					refresh_funct_title = False,
					refresh_funct_no_results = False,
					refresh_funct_syntax_file = False
					):

		if not refresh_funct_view:
			pass
		else:
			object = Object()
			object.command = refresh_funct_command
			object.item = SideBarItem(refresh_funct_item, os.path.isdir(refresh_funct_item))
			object.to_status_bar = refresh_funct_to_status_bar
			object.title = refresh_funct_title
			object.no_results = refresh_funct_no_results
			object.syntax_file = refresh_funct_syntax_file

		debug = False
		if debug:
			print '----------------------------------------------------------'
			print 'GIT:'
			print object.command
			print 'CWD:'
			print object.item.forCwdSystemPath()
			print 'PATH:'
			print object.item.forCwdSystemName()

		failed = False

		import sys
		if sys.platform == 'win32':
			object.command = map(self.escapeCMDWindows, object.command)

		cwd = object.item.forCwdSystemPath()

		try:
			if not modal :
				process = subprocess.Popen(
																	object.command,
																	cwd=cwd,
																	stdout=subprocess.PIPE,
																	stderr=subprocess.STDOUT,
																	shell= sys.platform == 'win32',
																	universal_newlines=True)
			else:
				if sys.platform == 'win32':
					process = subprocess.Popen(
																		#" ".join(object.command),
																		object.command,
																		cwd=cwd,
																		stdout=subprocess.PIPE,
																		stderr=subprocess.STDOUT,
																		shell=True,
																		universal_newlines=True)
				else:
					process = subprocess.Popen(
																		object.command,
																		cwd=cwd,
																		stdout=subprocess.PIPE,
																		stderr=subprocess.STDOUT,
																		shell=False,
																		universal_newlines=True)

			if background:
				if debug:
					print 'SUCCESS'
					print '----------------------------------------------------------'
				return True

			stdout, stderr = process.communicate()
			SideBarGit.last_stdout = str(stdout).rstrip()
			self.last_stdout = str(stdout).rstrip()

			stdout = stdout.strip()

			if stdout.find('fatal:') == 0 or stdout.find('error:') == 0 or stdout.find('Permission denied') == 0 or stderr:
				print 'FAILED'
				failed = True
			else:
				if debug:
					print 'SUCCESS'
			if stdout:
				if debug:
					print 'STDOUT'
					print stdout
			if stderr:
				print 'STDERR'
				print stderr
		except OSError as (errno, strerror):
			print 'FAILED'
			failed = True
#.........这里部分代码省略.........
开发者ID:naholyr,项目名称:sublime-text-2__config,代码行数:103,代码来源:SideBarGit.py


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