本文整理汇总了Python中rebasehelper.base_output.OutputLogger.set_info_text方法的典型用法代码示例。如果您正苦于以下问题:Python OutputLogger.set_info_text方法的具体用法?Python OutputLogger.set_info_text怎么用?Python OutputLogger.set_info_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rebasehelper.base_output.OutputLogger
的用法示例。
在下文中一共展示了OutputLogger.set_info_text方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_check
# 需要导入模块: from rebasehelper.base_output import OutputLogger [as 别名]
# 或者: from rebasehelper.base_output.OutputLogger import set_info_text [as 别名]
def run_check(cls, results_dir):
""" Compares old and new RPMs using pkgdiff """
cls.results_dir = results_dir
cls.pkgdiff_results_full_path = os.path.join(cls.results_dir, cls.pkgdiff_results_filename)
versions = ['old', 'new']
cmd = [cls.CMD]
for version in versions:
old = OutputLogger.get_build(version)
if old:
file_name = cls._create_xml(version, input_structure=old)
cmd.append(file_name)
cmd.append('-extra-info')
cmd.append(cls.results_dir)
cmd.append('-report-path')
cmd.append(cls.pkgdiff_results_full_path)
ret_code = ProcessHelper.run_subprocess(cmd, output=ProcessHelper.DEV_NULL)
"""
From pkgdiff source code:
ret_code 0 means unchanged
ret_code 1 means Changed
other return codes means error
"""
if int(ret_code) != 0 and int(ret_code) != 1:
raise RebaseHelperError('Execution of %s failed.\nCommand line is: %s', cls.CMD, cmd)
OutputLogger.set_info_text('Result HTML page from pkgdiff is store in: ', cls.pkgdiff_results_full_path)
results_dict = cls.process_xml_results(cls.results_dir)
text = []
for key, val in six.iteritems(results_dict):
text.append('Following files were %s:\n%s' % (key, '\n'.join(val)))
return text
示例2: print_summary
# 需要导入模块: from rebasehelper.base_output import OutputLogger [as 别名]
# 或者: from rebasehelper.base_output.OutputLogger import set_info_text [as 别名]
def print_summary(cls, path):
"""
Function is used for printing summary informations
:return:
"""
# First of all we would like to print all
# summary information
OutputLogger.set_info_text("Summary output is also available in log:", path)
logger.info('\n')
for key, value in six.iteritems(OutputLogger.get_summary_info()):
logger.info("%s %s\n", key, value)
try:
LoggerHelper.add_file_handler(logger_output, path)
except (OSError, IOError):
raise RebaseHelperError("Can not create results file '%s'", path)
type_pkgs = ['old', 'new']
cls.print_patches(OutputLogger.get_patches(), '\nSummary information about patches:')
for pkg in type_pkgs:
type_pkg = OutputLogger.get_build(pkg)
if type_pkg:
cls.print_rpms(type_pkg, pkg.capitalize())
cls.print_build_logs(type_pkg, pkg.capitalize())
cls.print_pkgdiff_tool()
示例3: _prepare_spec_objects
# 需要导入模块: from rebasehelper.base_output import OutputLogger [as 别名]
# 或者: from rebasehelper.base_output.OutputLogger import set_info_text [as 别名]
def _prepare_spec_objects(self):
"""
Prepare spec files and initialize objects
:return:
"""
self.rebase_spec_file_path = get_rebase_name(self.spec_file_path)
self.spec_file = SpecFile(self.spec_file_path,
self.execution_dir,
download=not self.conf.not_download_sources)
# Check whether test suite is enabled at build time
if not self.spec_file.is_test_suite_enabled():
OutputLogger.set_info_text('WARNING', 'Test suite is not enabled at build time.')
# create an object representing the rebased SPEC file
self.rebase_spec_file = self.spec_file.copy(self.rebase_spec_file_path)
# check if argument passed as new source is a file or just a version
if [True for ext in Archive.get_supported_archives() if self.conf.sources.endswith(ext)]:
logger.debug("argument passed as a new source is a file")
self.rebase_spec_file.set_version_using_archive(self.conf.sources)
else:
logger.debug("argument passed as a new source is a version")
version, extra_version = SpecFile.split_version_string(self.conf.sources)
self.rebase_spec_file.set_version(version)
if extra_version:
self.rebase_spec_file.set_extra_version(extra_version)
示例4: setup
# 需要导入模块: from rebasehelper.base_output import OutputLogger [as 别名]
# 或者: from rebasehelper.base_output.OutputLogger import set_info_text [as 别名]
def setup(self):
OutputLogger.set_info_text('Information text', 'some information text')
OutputLogger.set_info_text('Next Information', 'some another information text')
OutputLogger.set_patch_output('Patches:', self.patches_data)
OutputLogger.set_build_data('old', self.old_rpm_data)
OutputLogger.set_build_data('new', self.new_rpm_data)