Commit 00ac0eb8 authored by canterburym's avatar canterburym
Browse files

Adding separate parse script

parent de7813aa
Pipeline #2578 passed with stage
in 1 minute and 20 seconds
import logging
from asn1tools import parse_files, ParseError
from pathlib import Path
from pprint import pprint
if __name__ == '__main__':
fileList = list(Path(".").rglob("*.asn1")) + list(Path(".").rglob("*.asn"))
if len(fileList) == 0:
logging.warning ("No files specified")
exit(0)
print ("ASN.1 Parser checks:")
print ("-----------------------------")
logging.info("Parsing files...")
errorCount = 0
for f in fileList:
try:
parse_files(str(f))
except ParseError as ex:
logging.info (f" {f}: Failed - {ex!r}")
print (f" {f}: Failed - {ex!r}")
errorCount += 1
continue
print (f" {f}: OK")
print ("-----------------------------")
print (f"Parse errors: {errorCount}")
print ("-----------------------------")
exit(errorCount)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment