def make_records_from_translator(database, translator, profile=None, parameters=None): """Makes records for the given translator. Accepts an optional profile to override the default profile, and a parameters dictionary to override parameters that are expected from the template that may or may not be provided by the translator. """ translator = processor_utils.get_fully_qualified_paths(database, translator, profile=profile) template = template_processor.get_template_by_name(translator['structure'], translator['template']) return template
def make_translators_from_filesystem(template): """Retrieves all the translators for a template from a filesystem and adds them to the database. """ template = processor_utils.get_fully_qualified_paths(database, template, profile=profile) translators = get_translators_from_filesystem(template) translator_maker = translator_model.make_translator_closure(template, general_utils.get_timestamp()) translators = list(map(translator_maker, translators)) return translators
def make_templates_from_filesystem(structure): """Retrieves all the templates for a structure from a filesystem and adds them to the database. """ structure = processor_utils.get_fully_qualified_paths(database, structure, profile=profile) templates = get_templates_from_filesystem(structure) template_maker = template_model.make_template_closure(structure, utils.get_timestamp()) templates = map(template_maker, templates) return templates
def make_translators_from_filesystem(template): """Retrieves all the translators for a template from a filesystem and adds them to the database. """ template = processor_utils.get_fully_qualified_paths(database, template, profile=profile) translators = get_translators_from_filesystem(template) translator_maker = translator_model.make_translator_closure(template, utils.get_timestamp()) translators = map(translator_maker, translators) return translators
def make_templates_from_filesystem(structure): """Retrieves all the templates for a structure from a filesystem and adds them to the database. """ structure = processor_utils.get_fully_qualified_paths(database, structure, profile=profile) templates = get_templates_from_filesystem(structure) template_maker = template_model.make_template_closure( structure, general_utils.get_timestamp()) templates = list(map(template_maker, templates)) return templates
def make_records_from_filesystem(translator): """This method gathers and adds filesystem records to the structure for the translator. It adds relevant information to each record that it returns, based on association and ability information from the template and structure. It returns the added records. """ translator = processor_utils.get_fully_qualified_paths(database, translator, profile=profile) records = get_records_from_filesystem(translator) template = template_processor.get_template_by_name(translator['structure'], translator['template']) record_maker = record_model.make_record_closure(template, translator, general_utils.get_timestamp()) records = list(map(record_maker, records)) return records
def make_records_from_filesystem(translator): """This method gathers and adds filesystem records to the structure for the translator. It adds relevant information to each record that it returns, based on association and ability information from the template and structure. It returns the added records. """ translator = processor_utils.get_fully_qualified_paths(database, translator, profile=profile) records = get_records_from_filesystem(translator) template = template_processor.get_template_by_name(translator['structure'], translator['template']) record_maker = record_model.make_record_closure(template, translator, utils.get_timestamp()) records = map(record_maker, records) return records