Update EXPRESS code generator to work on ancient IFC schemas

This commit is contained in:
Thomas Krijnen
2016-04-08 23:23:29 +02:00
parent 63c3b54762
commit 0ff9de3cd9
8 changed files with 86 additions and 24 deletions
+4 -2
View File
@@ -31,12 +31,14 @@ import re
import os
import csv
from schema import OrderedCaseInsensitiveDict
try: from html.entities import entitydefs
except: from htmlentitydefs import entitydefs
make_absolute = lambda fn: os.path.join(os.path.dirname(os.path.realpath(__file__)), fn)
name_to_oid = {}
name_to_oid = OrderedCaseInsensitiveDict()
oid_to_desc = {}
oid_to_name = {}
oid_to_pid = {}
@@ -59,7 +61,7 @@ with open(make_absolute('DocAttribute.csv')) as f:
for oid, name, desc in csv.reader(f, delimiter=';', quotechar='"'):
pid = oid_to_pid[oid]
pname = oid_to_name[pid]
name_to_oid[(pname, name)] = oid
name_to_oid[".".join((pname, name))] = oid
oid_to_desc[oid] = desc
def description(item):