def parse_file(fname): content = read_file(fname) try: mparser = msc_pyparser.MSCParser() mparser.parser.parse(content) except: print("Can't parse data") print(sys.exc_info()) sys.exit(1) return mparser.configlines
if st == u.IS_FILE: configs.append(srcobj) configs.sort() for c in configs: print("Parsing CRS config: %s" % c) cname = os.path.basename(c) dname = cname.replace(".conf", ".yaml") try: with open(c) as file: data = file.read() except: print("Exception catched - ", sys.exc_info()) sys.exit(-1) try: mparser = msc_pyparser.MSCParser() mparser.parser.parse(data) except: print(sys.exc_info()[1]) sys.exit(-1) try: chk = Check(mparser.configlines, dstobj) chk.collectrx() except: print(sys.exc_info()[1]) sys.exit(-1)
def mparser(): return msc_pyparser.MSCParser()