本文整理汇总了Python中Utils.Object.to_status_bar方法的典型用法代码示例。如果您正苦于以下问题:Python Object.to_status_bar方法的具体用法?Python Object.to_status_bar怎么用?Python Object.to_status_bar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Object
的用法示例。
在下文中一共展示了Object.to_status_bar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from Utils import Object [as 别名]
# 或者: from Utils.Object import to_status_bar [as 别名]
def run(self, paths = []):
for repo in SideBarGit().getSelectedRepos(SideBarSelection(paths).getSelectedItems()):
object = Object()
object.item = repo.repository
object.command = ['git', 'checkout', 'master']
object.to_status_bar = True
SideBarGit().run(object)
示例2: on_done
# 需要导入模块: from Utils import Object [as 别名]
# 或者: from Utils.Object import to_status_bar [as 别名]
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)
示例3: run
# 需要导入模块: from Utils import Object [as 别名]
# 或者: from Utils.Object import to_status_bar [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
#.........这里部分代码省略.........