def set_file_actions(name, actionlist, output): """Set file actions output path""" file_actions = [action for action in actionlist if action.valid_last] for index, file_action in enumerate(file_actions): file_action.set_field('In', '%s' % output) file_action.set_field( 'File Name', '<filename>_%s' % utils.indexed_name(name, index)) return actionlist
def set_file_actions(name, actionlist, output): """Set file actions output path""" file_actions = [action for action in actionlist if action.valid_last] for index, file_action in enumerate(file_actions): file_action.set_field( 'In', '%s' % output) file_action.set_field( 'File Name', '<filename>_%s' % utils.indexed_name(name, index)) return actionlist
def generate_library_actionlists(output=''): """Build library actionlists :param output: the processed image output path :type output: string""" actionlists_info = {} for name, actionlist in get_library_list().iteritems(): file_actions = [ action for action in actionlist['actions'] if action['label'].lower() in get_file_actions() ] for index, file_action in enumerate(file_actions): file_action['fields']['In'] = '%s' % output file_action['fields']['File Name'] =\ '<filename>-%s' % utils.indexed_name(name, index) output_path = os.path.join(config.OUT_ACTIONLISTS_PATH, '%s.phatch' % name) utils.write_file(output_path, repr(actionlist)) actionlists_info[name] = output_path return actionlists_info
def generate_library_actionlists(output=''): """Build library actionlists :param output: the processed image output path :type output: string""" logging.info('Generating library actionlists...') actionlists_info = {} for name, actionlist in get_library_list().iteritems(): file_actions = [ action for action in actionlist['actions'] if action['label'].lower() in get_file_actions()] for index, file_action in enumerate(file_actions): file_action['fields']['In'] = '%s' % output file_action['fields']['File Name'] =\ '<filename>_%s' % utils.indexed_name(name, index) output_path = os.path.join( config.OUT_ACTIONLISTS_PATH, '%s.phatch' % name) utils.write_file(output_path, repr(actionlist)) actionlists_info[name] = output_path return actionlists_info