Loading testing/asn/asn_process.py +3 −6 Changes for testing/asn/asn_process.py: 3 added lines, 6 removed lines. Original line number Original line Diff line number Diff line import logging import logging import json import json import re from pathlib import Path from pathlib import Path from subprocess import run from subprocess import run from shutil import which from shutil import which Loading Loading @@ -77,12 +78,8 @@ duplicateObjects = { def fixDuplicateObjects(filename): def fixDuplicateObjects(filename): stringContent = filename.read_text() stringContent = filename.read_text() for object in duplicateObjects[filename.as_posix()]: for object in duplicateObjects[filename.as_posix()]: stringContent = stringContent.replace(f"{object} ::=", f"Native{object} ::=", 1) stringContent = re.sub(f"^({object} ::=)", 'Native\\1', stringContent, flags=re.MULTILINE) stringContent = stringContent.replace( stringContent = re.sub(f"^SEQUENCE (\(SIZE\(\d+\.\.(\d+|MAX)\)\) )*OF ({object})", 'SEQUENCE \\1OF Native\\2', stringContent, flags=re.MULTILINE) f"SEQUENCE OF {object}", f"SEQUENCE OF Native{object}" ) # stringContent = sub(f"]\\w{object}", f"] Native{object}", stringContent) Path("temp.asn").write_text(stringContent) Path("temp.asn").write_text(stringContent) return "temp.asn" return "temp.asn" Loading Loading
testing/asn/asn_process.py +3 −6 Changes for testing/asn/asn_process.py: 3 added lines, 6 removed lines. Original line number Original line Diff line number Diff line import logging import logging import json import json import re from pathlib import Path from pathlib import Path from subprocess import run from subprocess import run from shutil import which from shutil import which Loading Loading @@ -77,12 +78,8 @@ duplicateObjects = { def fixDuplicateObjects(filename): def fixDuplicateObjects(filename): stringContent = filename.read_text() stringContent = filename.read_text() for object in duplicateObjects[filename.as_posix()]: for object in duplicateObjects[filename.as_posix()]: stringContent = stringContent.replace(f"{object} ::=", f"Native{object} ::=", 1) stringContent = re.sub(f"^({object} ::=)", 'Native\\1', stringContent, flags=re.MULTILINE) stringContent = stringContent.replace( stringContent = re.sub(f"^SEQUENCE (\(SIZE\(\d+\.\.(\d+|MAX)\)\) )*OF ({object})", 'SEQUENCE \\1OF Native\\2', stringContent, flags=re.MULTILINE) f"SEQUENCE OF {object}", f"SEQUENCE OF Native{object}" ) # stringContent = sub(f"]\\w{object}", f"] Native{object}", stringContent) Path("temp.asn").write_text(stringContent) Path("temp.asn").write_text(stringContent) return "temp.asn" return "temp.asn" Loading