Pārlūkot izejas kodu

Make order of classes in generated IFC parsing code deterministic.

Alexander Gessler 10 gadi atpakaļ
vecāks
revīzija
55ca72e1c8
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      scripts/IFCImporter/ExpressReader.py

+ 3 - 2
scripts/IFCImporter/ExpressReader.py

@@ -44,6 +44,7 @@
 entities and data types contained"""
 entities and data types contained"""
 
 
 import sys, os, re
 import sys, os, re
+from collections import OrderedDict
 
 
 re_match_entity = re.compile(r"""
 re_match_entity = re.compile(r"""
 ENTITY\s+(\w+)\s*                                    # 'ENTITY foo'
 ENTITY\s+(\w+)\s*                                    # 'ENTITY foo'
@@ -68,8 +69,8 @@ re_match_field = re.compile(r"""
 
 
 class Schema:
 class Schema:
     def __init__(self):
     def __init__(self):
-        self.entities = {}
-        self.types = {}
+        self.entities = OrderedDict()
+        self.types = OrderedDict()
 
 
 class Entity:
 class Entity:
     def __init__(self,name,parent,members):
     def __init__(self,name,parent,members):