From 6153f24cf2175735bb6b3ee97e0ede0b191b29c1 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 9 Apr 2024 12:31:14 +0200 Subject: [PATCH 1/2] add text to autopygen exceptions --- .../source_file_parsing/parser_discovery_and_init.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py b/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py index de2555164..a0b1b6c3f 100644 --- a/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py +++ b/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py @@ -82,7 +82,7 @@ def visit_ImportFrom(self, node: ast.ImportFrom) -> Any: def report_findings(self) -> Tuple[List[ast.AST], Optional[str], Optional[str], Set[str]]: if self.argparse_module_alias is None and self.argument_parser_alias is None: - raise ArgParseImportNotFound() + raise ArgParseImportNotFound("No argparse import found") return (self.actions, self.argparse_module_alias, self.argument_parser_alias, self.known_names) @@ -165,7 +165,7 @@ def _replace_parser(self, node: ast.Assign, imported_using_from: bool): def report_findings(self) -> Tuple: if self.main_parser_name is None: - raise ArgParserNotUsed + raise ArgParserNotUsed("Atgument parser not used") return self.actions, self.main_parser_name @@ -243,7 +243,7 @@ def get_parser_init_and_actions(source: ast.Module) -> Tuple[List[ast.AST], str, custom_parser_class_def = obtain_class_def() if custom_parser_class_def is None: - raise CustomParserUnavailableException() + raise CustomParserUnavailableException("Custom parser unavailable") import_discovery = ImportDiscovery(actions) actions, argparse_module_alias, argparse_class_alias, known_names = import_discovery.visit_and_report(source) From 0ba465193450c818e20693c7c4637316c92eba4d Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Thu, 11 Apr 2024 09:45:50 +0200 Subject: [PATCH 2/2] Fix Atgument typo --- .../autopygen/source_file_parsing/parser_discovery_and_init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py b/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py index a0b1b6c3f..7f36e50cd 100644 --- a/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py +++ b/planemo/autopygen/source_file_parsing/parser_discovery_and_init.py @@ -165,7 +165,7 @@ def _replace_parser(self, node: ast.Assign, imported_using_from: bool): def report_findings(self) -> Tuple: if self.main_parser_name is None: - raise ArgParserNotUsed("Atgument parser not used") + raise ArgParserNotUsed("Argument parser not used") return self.actions, self.main_parser_name