예제 #1
0
 def create_build_use_case(self) -> BuildConfigurationUC:
     """
     Plumbing to make build use case working.
     """
     configuration_io = YamlConfigurationIO(self.args.output)
     code_parser = PythonParser()
     source_files = source_file_iterator(self.args.root_dir)
     return BuildConfigurationUC(configuration_io, code_parser, source_files)
예제 #2
0
 def create_build_use_case(self) -> BuildConfigurationUC:
     """
     Plumbing to make build use case working.
     """
     configuration_io = YamlConfigurationIO(self.args.output)
     code_parser = (PythonParser()
                    if self.args.lang in ["py", "python"] else GoParser())
     source_files = source_file_iterator(self.args.root_dir,
                                         self.args.lang[:2])
     return BuildConfigurationUC(configuration_io, code_parser,
                                 source_files, self.args.lang)
예제 #3
0
    def create_graph_use_case(self) -> DrawGraphUC:
        """
        Plumbing to make draw_graph use case working.
        """
        graph_conf = read_graph_config(self.args.config) if self.args.config else None

        code_parser = PythonParser()
        source_files = source_file_iterator(self.args.root_dir)
        graph = Graph(self.args.output, graph_conf)
        graph_drawer = GraphDrawer(graph)
        return DrawGraphUC(graph_drawer, code_parser, source_files, graph_conf)
예제 #4
0
 def create_check_use_case(self) -> CheckDependenciesUC:
     """
     Plumbing to make check use case working.
     """
     configuration = YamlConfigurationIO(self.args.config).read()
     code_parser = PythonParser()
     report_printer = ReportPrinter()
     source_files = source_file_iterator(self.args.root_dir)
     return CheckDependenciesUC(
         configuration, report_printer, code_parser, source_files
     )
예제 #5
0
    def create_graph_use_case(self) -> DrawGraphUC:
        """
        Plumbing to make draw_graph use case working.
        """
        graph_conf = read_graph_config(self.args.config) if self.args.config else None

        if self.args.lang:
            lang = self.args.lang
        elif graph_conf and "lang" in graph_conf:
            lang = graph_conf["lang"]
        else:
            lang = "python"

        code_parser = PythonParser() if lang in ["py", "python"] else GoParser()
        source_files = source_file_iterator(self.args.root_dir, lang[:2])
        graph = Graph(self.args.output, graph_conf)
        graph_drawer = GraphDrawer(graph)
        return DrawGraphUC(graph_drawer, code_parser, source_files, graph_conf)