def __init__(
         self,
         file_to_module_map_supply,
         module_grouper,
         report_filename,
         generation_log=GenerationLogGenerator(),
         dependency_filter_outputter=DependencyFilterOutputter,
         text_graph_outputter_factory=DecoratingTextGraphOutputterFactory(),
 ):
     self.__file_include_deps_printer = FileIncludeDepsProcessor(
         file_to_module_map_supply=file_to_module_map_supply)
     self.__module_grouper = module_grouper
     self.__report_file = open(report_filename, "wt")
     self.__report_filename = report_filename
     self.__formatter = TextDocumentFormatter()
     self.__dependency_filter_outputter = dependency_filter_outputter
     self.__text_graph_outputter_factory = text_graph_outputter_factory
     self.__generation_log = generation_log
Exemple #2
0

class NodeGroupingConfigurationDecorator(NodeGroupingConfiguration):
    def __init__(self, node_grouping_configuration, node_grouper_decorator):
        self.__decoratee = node_grouping_configuration
        self.__node_grouper = node_grouper_decorator(
            decoratee=node_grouping_configuration.get_node_grouper())

    def collapse_node_group(self, module_group_prefix):
        return self.__decoratee.collapse_node_group(module_group_prefix)

    def get_node_grouper(self):
        return self.__node_grouper


config_generation_log = GenerationLogGenerator()


# TODO This class should not be subclassed. Construction of the decorator set should be done
# by a separate class.
class DependencyFilterOutputter(AutoConfigurable, ConfigDependent):
    def __init__(self, decorator_config, base_graph=None, *args, **kwargs):
        AutoConfigurable.__init__(self, *args, **kwargs)
        self.outputters = config_outputter_configuration.outputters()
        assert isinstance(decorator_config, DecoratorSet)
        self.__decorator_config = decorator_config
        self.__logger = logging.getLogger(self.__class__.__module__)

    def add_decorators(self, decorator_config):
        self.__decorator_config.add_decorator_set(decorator_config)
 def __init__(self, *args, **kwargs):
     GenerationLogGenerator.__init__(self, *args, **kwargs)
     self.__log = None
     self.__logger = logging.getLogger(self.__class__.__module__)