Commit d1fe86a6 authored by mewburn's avatar mewburn
Browse files

Merge branch 'draft/mc/generic-messaing-fix' into 'draft/lukem/generic-messaging'

Draft/mc/generic messaing fix

See merge request li/schemas-definitions!121
parents 1b0e6524 fa5b71d5
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -488,8 +488,8 @@ Messaging-Property ::= CHOICE
    requested-reports   [10] Messaging-Property-Requested-Reports,
    requested-reports   [10] Messaging-Property-Requested-Reports,
    expires             [11] GeneralizedTime,
    expires             [11] GeneralizedTime,
    message-date        [12] GeneralizedTime,
    message-date        [12] GeneralizedTime,
    server-octets-sent  [13] INTEGER (0..18446744073709551615) OPTIONAL,
    server-octets-sent  [13] INTEGER (0..18446744073709551615),
    client-octets-sent  [14] INTEGER (0..18446744073709551615) OPTIONAL
    client-octets-sent  [14] INTEGER (0..18446744073709551615)
}
}


Messaging-Property-Priority ::= ENUMERATED
Messaging-Property-Priority ::= ENUMERATED
+8 −6
Original line number Original line Diff line number Diff line
@@ -7,13 +7,14 @@ from re import sub
from pycrate_asn1c.asnproc import *
from pycrate_asn1c.asnproc import *


def reconstrainInteger (filename):
def reconstrainInteger (filename):
    Path('temp.asn').write_text(Path(filename).read_text().replace("18446744073709551615", "65536"))
    Path(filename + '_bigint_temp.asn').write_text(Path(filename).read_text().replace("18446744073709551615", "65536"))
    return 'temp.asn'
    return filename + '_bigint_temp.asn'


filesWithBigInts = [
filesWithBigInts = [
    '102232-1/LI-PS-PDU.asn',
    '102232-1/LI-PS-PDU.asn',
    '102232-3/IPAccessPDU.asn',
    '102232-3/IPAccessPDU.asn',
    '102232-4/L2AccessPDU.asn'
    '102232-4/L2AccessPDU.asn',
    '102232-2/EmailPDU.asn'
]
]


def syntaxCheckASN (fileList):
def syntaxCheckASN (fileList):
@@ -68,6 +69,7 @@ duplicateObjects = {
        'ClashField'
        'ClashField'
    ]
    ]
}
}

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()]:
@@ -75,8 +77,8 @@ def fixDuplicateObjects(filename):
        stringContent = stringContent.replace(f'SEQUENCE OF {object}', f'SEQUENCE OF Native{object}')
        stringContent = stringContent.replace(f'SEQUENCE OF {object}', f'SEQUENCE OF Native{object}')
        #stringContent = sub(f"]\\w{object}", f"] Native{object}", stringContent)
        #stringContent = sub(f"]\\w{object}", f"] Native{object}", stringContent)


    Path('temp.asn').write_text(stringContent)
    Path(str(filename) + '_temp.asn').write_text(stringContent)
    return 'temp.asn'
    return str(filename) + '_temp.asn'




def compileAllTargets (compileTargets):
def compileAllTargets (compileTargets):
@@ -110,7 +112,7 @@ def compileAllTargets (compileTargets):
                if pFile.as_posix() in duplicateObjects:
                if pFile.as_posix() in duplicateObjects:
                    tmpFile = Path(fixDuplicateObjects(pFile))
                    tmpFile = Path(fixDuplicateObjects(pFile))
                    fileTexts.append(tmpFile.read_text())
                    fileTexts.append(tmpFile.read_text())
                    #tmpFile.unlink()
                    tmpFile.unlink()
                else:
                else:
                    fileTexts.append(pFile.read_text())
                    fileTexts.append(pFile.read_text())
                fileNames.append(filename)
                fileNames.append(filename)