Commit eb648d8e authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Addressed mypy findings for aadl2glueC.

parent 83c67471
......@@ -81,6 +81,8 @@ but with an extra call to OnFinal at the end.
import os
import sys
import hashlib
import pickle
import tempfile
from distutils import spawn
from typing import cast, Optional, Dict, List, Tuple, Set, Any # NOQA pylint: disable=unused-import
......@@ -154,8 +156,8 @@ of each SUBPROGRAM param.'''
panic("The configured cache folder:\n\n\t" + projectCache +
"\n\ not there!\n")
cachedModelExists = False
aadlASTcache = None
astInfo = None
if projectCache is not None:
filehash = hashlib.md5()
for each in sorted(sys.argv[1:]):
......@@ -167,15 +169,10 @@ of each SUBPROGRAM param.'''
print("[DMT] No cached AADL model found for",
cachedModelExists = True
print("[DMT] Reusing cached AADL model for",
import pickle
if cachedModelExists:
astInfo = pickle.load(open(aadlASTcache, 'rb'), fix_imports=False)
import tempfile
if astInfo is None:
f = tempfile.NamedTemporaryFile(delete=False)
astFile =
......@@ -547,14 +544,12 @@ def main() -> None:
asn1files = list(uniqueDataFiles.keys())
asnFile = None # type: Optional[str]
if len(asn1files) == 1:
asnFile = asn1files[0]
elif asn1files:
panic("There appear to be more than one ASN.1 files referenced (%s)..." % str(asn1files))
if asnFile is not None:
inform("Checking that all base nodes have mandatory ranges set in %s..." % asnFile)
names = commonPy.asnParser.g_names
for node in names.values():
Supports Markdown
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