From 5c5e5ff8e11c35e9b9d423179d700c4a136f53d5 Mon Sep 17 00:00:00 2001 From: James Bruten <109733895+james-bruten-mo@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:49:08 +0000 Subject: [PATCH] remove processing of docstrings (#45) --- 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 2f1f1c6..e8229e9 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