本文整理汇总了Python中rebasehelper.base_output.OutputLogger.set_patch_output方法的典型用法代码示例。如果您正苦于以下问题:Python OutputLogger.set_patch_output方法的具体用法?Python OutputLogger.set_patch_output怎么用?Python OutputLogger.set_patch_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rebasehelper.base_output.OutputLogger
的用法示例。
在下文中一共展示了OutputLogger.set_patch_output方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_text_output
# 需要导入模块: from rebasehelper.base_output import OutputLogger [as 别名]
# 或者: from rebasehelper.base_output.OutputLogger import set_patch_output [as 别名]
def test_text_output(self):
output = OutputTool('text')
data = self.get_data()
OutputLogger.set_build_data('old', data['old'])
OutputLogger.set_build_data('new', data['new'])
OutputLogger.set_patch_output('Patches:', data['patches'])
test_output = {'pkgdiff': ['Following files were moved\n%s' % '\n'.join(data['moved'])]}
OutputLogger.set_checker_output('Results from checker(s)', test_output)
logfile = os.path.join(self.TESTS_DIR, REBASE_HELPER_RESULTS_LOG)
output.print_information(logfile)
with open(logfile) as f:
lines = [y.strip() for y in f.readlines()]
assert lines == self.get_expected_output().split('\n')
os.unlink(logfile)
示例2: patch_sources
# 需要导入模块: from rebasehelper.base_output import OutputLogger [as 别名]
# 或者: from rebasehelper.base_output.OutputLogger import set_patch_output [as 别名]
def patch_sources(self, sources):
# Patch sources
git_helper = GitHelper(sources[0])
git_helper.check_git_config()
patch = Patcher(self.conf.patchtool)
self.rebase_spec_file.update_changelog(self.rebase_spec_file.get_new_log(git_helper))
try:
self.rebased_patches = patch.patch(sources[0],
sources[1],
self.rest_sources,
git_helper,
self.spec_file.get_applied_patches(),
self.spec_file.get_prep_section(),
**self.kwargs)
except RuntimeError as run_e:
raise RebaseHelperError('Patching failed')
self.rebase_spec_file.write_updated_patches(self.rebased_patches)
if self.conf.non_interactive:
OutputLogger.set_patch_output('Unapplied patches:', self.rebased_patches['unapplied'])
OutputLogger.set_patch_output('Patches:', self.rebased_patches)
示例3: setup
# 需要导入模块: from rebasehelper.base_output import OutputLogger [as 别名]
# 或者: from rebasehelper.base_output.OutputLogger import set_patch_output [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)