Esempio n. 1
0
def list_readable_tables():
    global readable_tables
    if readable_tables is not None:
        return readable_tables
    readable_tables = {}
    for component_name in veil_component.get_component_map().keys():
        readable_tables[component_name] = set(list_writable_tables().get(component_name, set()))
        transitive_dependencies = veil_component.get_transitive_dependencies(component_name)
        for dependency in transitive_dependencies:
            readable_tables[component_name] = readable_tables[component_name].union(
                set(list_writable_tables().get(dependency, set())))
    providers, consumers = list_dynamic_dependencies()
    for component_name, deps in consumers.items():
        for dep in deps:
            dep_type, db_and_table = dep
            if 'table' != dep_type:
                continue
            purpose, table = db_and_table.split('/')
            readable_tables.setdefault(component_name, set()).add((purpose, table))
    return readable_tables
Esempio n. 2
0
def list_parent_component_names(module_name):
    return [c for c in veil_component.get_component_map() if module_name.startswith('{}.'.format(c))]