blender-gdsimporter/test.py
Julian Daube 5d939157ed initial commit (work in progress)
python version of parser works, BUT
does not support AREF and SREF at the moment
2019-07-01 11:45:02 +02:00

21 lines
671 B
Python

import gds
import sys
for arg in sys.argv[1:]:
f = open(arg, "rb")
try:
lib = gds.parse_file(f)
print("file version: {}".format(lib.version))
print("last access: {}".format(lib.last_access.isoformat()))
print("last modification: {}".format(lib.last_mod.isoformat()))
print("m/unit : {}".format(lib.meters_per_unit))
print("unit/dbunit : {}".format(lib.units_per_dbunit))
print("library name : {}".format(lib.name))
print("contains a total of {} structure(s)".format(len(lib.structures)))
except gds.ParserError as e:
print("parser error: {}".format(e))
finally:
f.close()