From ccab35a19130c07e6084b4ebcc8ee98ee4e4f7f4 Mon Sep 17 00:00:00 2001 From: James Bruten Date: Mon, 16 Dec 2024 11:13:59 +0000 Subject: [PATCH] remove processing of docstrings --- lfric_macros/apply_macros.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lfric_macros/apply_macros.py b/lfric_macros/apply_macros.py index 2f1f1c6d..e8229e9f 100755 --- a/lfric_macros/apply_macros.py +++ b/lfric_macros/apply_macros.py @@ -125,13 +125,9 @@ def split_macros(parsed_versions): in_macro = False in_comment = False for line in parsed_versions: - if '"""' in line: - # If there is a comment marker in the line, check there aren't 2 - for _ in range(line.count('"""')): - in_comment = not in_comment - if in_comment: - continue - if line.startswith("class vn"): + if line.startswith("class vn") and not line.startswith( + "class vnXX_txxx" + ): # If the macro string is set, then append to the list. If it's # empty then this is the first macro we're looking at, so nothing to # append @@ -249,9 +245,7 @@ def set_rose_meta_path(self): When Jules Shared from Jules is enabled, self.jules_source will need adding here """ - rose_meta_path = ( - f"{self.root_path}:{self.core_source}" - ) + rose_meta_path = f"{self.root_path}:{self.core_source}" os.environ["ROSE_META_PATH"] = rose_meta_path def parse_application_section(self, meta_dir): @@ -441,7 +435,7 @@ def parse_macro(self, macro, meta_dir): in_function = True continue if ( - line_stripped.startswith("return") + line_stripped.startswith("return config, self.reports") or line_stripped.startswith("# Input your macro commands here") or line_stripped.lower().startswith("# add settings") or not in_function