From 8657624b10ba9d01e9a2c9893bdda010512bb8c4 Mon Sep 17 00:00:00 2001 From: coldino Date: Mon, 6 Nov 2023 21:40:24 +0000 Subject: [PATCH] Support shortTitle in mod headers Added for ASA currently but should be useful in future. --- automate/manifest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/automate/manifest.py b/automate/manifest.py index d5c21f91..411ee3c4 100644 --- a/automate/manifest.py +++ b/automate/manifest.py @@ -8,7 +8,9 @@ from utils.log import get_logger MANIFEST_FILENAME = '_manifest.json' -SHRINK_MOD_REGEX = r"{\n\s+(.+: .*),\n\s+(.+: .*),\n\s+(.+: .*)\n\s+}" +SHRINK_MOD_REGEX3 = r"{\n\s+(.+: .*),\n\s+(.+: .*),\n\s+(.+: .*)\n\s+}" +SHRINK_MOD_REGEX4 = r"{\n\s+(.+: .*),\n\s+(.+: .*),\n\s+(.+: .*),\n\s+(.+: .*)\n\s+}" +SHRINK_MOD_REGEX5 = r"{\n\s+(.+: .*),\n\s+(.+: .*),\n\s+(.+: .*),\n\s+(.+: .*),\n\s+(.+: .*)\n\s+}" __all__ = [ 'update_manifest', @@ -39,7 +41,9 @@ def _write_manifest(filename: Path, data: Dict[str, Any]): filename.parent.mkdir(parents=True, exist_ok=True) with open(filename, 'wt', encoding='utf-8', newline='\n') as f: content = json.dumps(data, indent='\t') - content = re.sub(SHRINK_MOD_REGEX, r'{ \1, \2, \3 }', content) + content = re.sub(SHRINK_MOD_REGEX3, r'{ \1, \2, \3 }', content) + content = re.sub(SHRINK_MOD_REGEX4, r'{ \1, \2, \3, \4 }', content) + content = re.sub(SHRINK_MOD_REGEX5, r'{ \1, \2, \3, \4, \5 }', content) f.write(content)