def clean(): """Clean generated files from previous run""" utils.remove_path(options.output) utils.remove_path(config.OUT_ACTIONLISTS_PATH) utils.remove_path(config.OUT_DIFF) utils.create_path(options.output) utils.create_path(config.OUT_ACTIONLISTS_PATH)
options=options.options, ) if errors: print 'Number of errors: %s' % len(errors) print 'Errors:\n\t%s' % '\n\t'.join(errors) else: print 'No errors' for image in os.listdir(options.output): path1 = os.path.join(options.output, image) if os.path.exists(path1): ok, reason = utils.verify_image_type(path1) if not ok: logging.info('Format/Ext Mismatch: %s' % reason) if options.compare: utils.create_path(config.OUT_DIFF) new = [] mismatch = [] output_files = [image for image in os.listdir(options.output)] for image in output_files: path1 = os.path.join(options.compare, image) if os.path.exists(path1): path2 = os.path.join(options.output, image) if not utils.compare(path1, path2): result = utils.analyze(path1, path2) logging.info('Mismatch: %s\nreason: %s' % (image, result['reason'])) if 'diff' in result: result['diff'].save( os.path.join(config.OUT_DIFF, image) + '.png') mismatch.append(image)
actionlists = [[convert_mode_action, save_action]] phatchtools.generate_actionlists( options.output, actionlists, include_file_action=True, ) phatchtools.generate_library_actionlists(options.output) if not options.no_execute: errors = phatchtools.execute_actionlists( options.input, options=options.options, ) if errors: report.info('Number of errors: %s' % len(errors)) report.info('Errors:\n\t%s' % '\n\t'.join(errors)) else: logging.info('No errors') if options.compare: utils.create_path(config.OUT_DIFF) new = [] mismatch = [] output_files = [ image for image in os.listdir(options.output)] for image in output_files: path1 = os.path.join(options.compare, image) if os.path.exists(path1): path2 = os.path.join(options.output, image) if not utils.compare(path1, path2): result = utils.analyze(path1, path2) report.info( 'Mismatch: %s\nreason: %s' % (image, result['reason'])) if 'diff' in result: result['diff'].save(