本文整理汇总了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)
示例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)
示例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
#.........这里部分代码省略.........