Loading testing/asn/asn_process.py +1 −29 Changes for testing/asn/asn_process.py: 1 added line, 29 removed lines. Original line number Diff line number Diff line Loading @@ -8,10 +8,6 @@ import subprocess import sys from pathlib import Path # Luke has fixed the updstream issue with multiple imports in pycrate # https://github.com/pycrate-org/pycrate/pull/57 # but it isn't yet included in the distribution (still at 0.7.11 , Jul 2025) # When this gets updated we may be able to use only pycrate, and drop the use of asn1c import pycrate_asn1c.asnproc import pycrate_asn1c.utils Loading Loading @@ -88,28 +84,9 @@ def syntaxCheckASN(fileList): return results duplicateObjects = { "102232-1/LI-PS-PDU.asn": ["CCPayload", "IRIPayload", "Location"], "testing/mod1.asn": ["ClashField"], } def fixDuplicateObjects(filename): stringContent = filename.read_text() for object in duplicateObjects[filename.as_posix()]: stringContent = stringContent.replace(f"{object} ::=", f"Native{object} ::=", 1) stringContent = stringContent.replace( f"SEQUENCE OF {object}", f"SEQUENCE OF Native{object}" ) # stringContent = sub(f"]\\w{object}", f"] Native{object}", stringContent) Path("temp.asn").write_text(stringContent) return "temp.asn" def compileAllTargets(compileTargets): """ Attempts to compile a set of compile targets using the pycrate ASN1 tools Attempts to compile a set of compile targets using the pycrate ASN.1 tools :param compileTargets: list of compile targets, each of which is a list of filenames :returns: A dict of outcome against the first filename of each compile target. Return code and message are included for failures. Loading @@ -135,11 +112,6 @@ def compileAllTargets(compileTargets): pycrate_asn1c.asnproc.GLOBAL.clear() for filename in target: pFile = Path(filename) if pFile.as_posix() in duplicateObjects: tmpFile = Path(fixDuplicateObjects(pFile)) fileTexts.append(tmpFile.read_text()) # tmpFile.unlink() else: fileTexts.append(pFile.read_text()) fileNames.append(filename) logger.debug(f" Loading {filename}") Loading Loading
testing/asn/asn_process.py +1 −29 Changes for testing/asn/asn_process.py: 1 added line, 29 removed lines. Original line number Diff line number Diff line Loading @@ -8,10 +8,6 @@ import subprocess import sys from pathlib import Path # Luke has fixed the updstream issue with multiple imports in pycrate # https://github.com/pycrate-org/pycrate/pull/57 # but it isn't yet included in the distribution (still at 0.7.11 , Jul 2025) # When this gets updated we may be able to use only pycrate, and drop the use of asn1c import pycrate_asn1c.asnproc import pycrate_asn1c.utils Loading Loading @@ -88,28 +84,9 @@ def syntaxCheckASN(fileList): return results duplicateObjects = { "102232-1/LI-PS-PDU.asn": ["CCPayload", "IRIPayload", "Location"], "testing/mod1.asn": ["ClashField"], } def fixDuplicateObjects(filename): stringContent = filename.read_text() for object in duplicateObjects[filename.as_posix()]: stringContent = stringContent.replace(f"{object} ::=", f"Native{object} ::=", 1) stringContent = stringContent.replace( f"SEQUENCE OF {object}", f"SEQUENCE OF Native{object}" ) # stringContent = sub(f"]\\w{object}", f"] Native{object}", stringContent) Path("temp.asn").write_text(stringContent) return "temp.asn" def compileAllTargets(compileTargets): """ Attempts to compile a set of compile targets using the pycrate ASN1 tools Attempts to compile a set of compile targets using the pycrate ASN.1 tools :param compileTargets: list of compile targets, each of which is a list of filenames :returns: A dict of outcome against the first filename of each compile target. Return code and message are included for failures. Loading @@ -135,11 +112,6 @@ def compileAllTargets(compileTargets): pycrate_asn1c.asnproc.GLOBAL.clear() for filename in target: pFile = Path(filename) if pFile.as_posix() in duplicateObjects: tmpFile = Path(fixDuplicateObjects(pFile)) fileTexts.append(tmpFile.read_text()) # tmpFile.unlink() else: fileTexts.append(pFile.read_text()) fileNames.append(filename) logger.debug(f" Loading {filename}") Loading