Example #1
0
def get_templates_from_filesystem(structure):
    """Gets the templates from the filesystem for the given structure.
    """
    template_directory = structure['setup']['template_directory']
    search_dictionary = processor_utils.make_search_dictionary(template_directory, 'template')
    template_files = directory_tools.get_matching_files(search_dictionary)
    templates = map(get_template_dictionary_from_file, template_files)
    return templates
Example #2
0
def get_structures_from_filesystem(structure_directory):
    """Uses the passed directory to retrieve all the structure definitions.
    Returns a list of the structure dictionary objects.
    """
    search_dictionary = processor_utils.make_search_dictionary(structure_directory, 'definition')
    structure_files = directory_tools.get_matching_files(search_dictionary)
    structures = map(get_structure_dictionary_from_file, structure_files)
    return structures
Example #3
0
def get_translators_from_filesystem(template):
    """Gets the translators from the filesystem for the given template.
    """
    translator_directory = template["setup"]["translator_directory"]
    search_dictionary = processor_utils.make_search_dictionary(translator_directory, "translator")
    translator_files = directory_tools.get_matching_files(search_dictionary)
    translators = map(get_translator_dictionary_from_file, translator_files)
    return translators