def print_patches_section_cli(cls, color, patch_type): """ Print info about one of the patches key section :param color: color used for the message printing :param patch_type: string containing key for the patch_dict """ patches = results_store.get_patches() if not patches: return if patch_type in patches: print('\n%s patches:' % patch_type) for patch in patches[patch_type]: ConsoleHelper.cprint(patch, color=color)
def print_report_file_path(cls): """Print path to the report file""" ConsoleHelper.cprint('%s report:' % cls.NAME, color='yellow') print( '%s' % os.path.join(cls.app.results_dir, 'report.' + cls.get_extension()))
def print_cli_summary(cls, app): """ Print report of the rebase :param app: Application instance """ cls.app = app cls.print_patches_cli() ConsoleHelper.cprint('\nAvailable logs:', color='yellow') print('{0}:\n{1}'.format('Debug log', app.debug_log_file)) if results_store.get_old_build() is not None: print('{0}:\n{1}'.format( 'Old build logs and (S)RPMs', os.path.join(app.results_dir, 'old-build'))) if results_store.get_new_build() is not None: print('{0}:\n{1}'.format( 'New build logs and (S)RPMs', os.path.join(app.results_dir, 'new-build'))) print('') ConsoleHelper.cprint('%s:' % 'Rebased sources', color='yellow') print("%s" % app.rebased_sources_dir) ConsoleHelper.cprint('%s:' % 'Generated patch', color='yellow') print("%s\n" % os.path.join(app.results_dir, 'changes.patch')) cls.print_report_file_path() result = results_store.get_result_message() if not app.conf.patch_only: if 'success' in result: ConsoleHelper.cprint('\n%s' % result['success'], color='green') # Error is printed out through exception caught in CliHelper.run() else: if results_store.get_patches()['success']: ConsoleHelper.cprint("\nPatching successful", color='green') elif results_store.get_patches()['success']: ConsoleHelper.cprint("\nPatching failed", color='red')