本文整理汇总了Python中common_py.system.executor.Executor.run_cmd_output方法的典型用法代码示例。如果您正苦于以下问题:Python Executor.run_cmd_output方法的具体用法?Python Executor.run_cmd_output怎么用?Python Executor.run_cmd_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common_py.system.executor.Executor
的用法示例。
在下文中一共展示了Executor.run_cmd_output方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd_output [as 别名]
def check(self):
self.error_count = 0
if not self._node or not self._eslint:
return
args = ['src', '-f', 'codeframe']
if self._options and self._options.autoedit:
args.append('--fix')
output = ex.run_cmd_output(self._eslint, args, quiet=True)
match = re.search('(\d+) error', output)
if match:
self.error_count = int(match.group(1))
# Delete unnecessary error messages.
self.errors = output.split('\n')[:-4]
示例2: check
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd_output [as 别名]
def check(self, files):
if not self._clang_format:
return
for file in filter(self.is_checked_by_clang, files):
args = ['-style=file', file]
if self._options and self._options.autoedit:
args.append('-i')
output = ex.run_cmd_output(self._clang_format,
args,
quiet=True)
if output:
with tempfile.NamedTemporaryFile() as temp:
temp.write(output)
temp.flush() # just to be really safe
self._diff(file, temp.name)
示例3: __init__
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd_output [as 别名]
def __init__(self, options):
self.iotjs = fs.abspath(options.iotjs)
self.quiet = options.quiet
self.timeout = options.timeout
self.valgrind = options.valgrind
self.coverage = options.coverage
self.skip_modules = []
self.results = {}
if options.skip_modules:
self.skip_modules = options.skip_modules.split(",")
# Process the iotjs build information.
iotjs_output = ex.run_cmd_output(self.iotjs, [path.BUILD_INFO_PATH])
build_info = json.loads(iotjs_output)
self.builtins = build_info["builtins"]
self.stability = build_info["stability"]
# Define own alarm handler to handle timeout.
signal.signal(signal.SIGALRM, alarm_handler)
示例4: git_check_master
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd_output [as 别名]
def git_check_master():
return not ex.run_cmd_output('git diff master origin/master')
示例5: git_current_branch
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd_output [as 别名]
def git_current_branch():
return ex.run_cmd_output('git rev-parse --abbrev-ref HEAD')
示例6: git_cache_credential
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd_output [as 别名]
def git_cache_credential():
return ex.run_cmd_output('git config --global credential.helper cache')