py3: iteritems -> items, iterkeys -> keys

This commit is contained in:
looooo
2018-12-08 00:03:31 +01:00
committed by Yorik van Havre
parent 9d395235b9
commit 1476caf281
9 changed files with 17 additions and 17 deletions

View File

@@ -814,7 +814,7 @@ def insert(filename,docname,skip=[],only=[],root=None):
else:
# pre-0.18 objects, only support a small subset of types
r = ptype[3:]
tr = dict((v,k) for k, v in translationtable.iteritems())
tr = dict((v,k) for k, v in translationtable.items())
if r in tr.keys():
r = tr[r]
# remove the "StandardCase"

View File

@@ -1145,7 +1145,7 @@ def export(exportList,filename):
if DEBUG: print("Object type ", otype, " is not supported yet.")
# processing groups
for name,entities in groups.iteritems():
for name,entities in groups.items():
if entities:
o = FreeCAD.ActiveDocument.getObject(name)
if o:
@@ -1681,14 +1681,14 @@ class IfcDocument:
self.filename = filename
self.data = f.entById
self.Entities = {0:f.header}
for k,e in self.data.iteritems():
for k,e in self.data.items():
eid = int(e['id'])
self.Entities[eid] = IfcEntity(e,self)
if DEBUG: print(len(self.Entities),"entities created. Creating attributes...")
for k,ent in self.Entities.iteritems():
for k,ent in self.Entities.items():
if DEBUG: print("attributing entity ",ent)
if hasattr(ent,"attributes"):
for k,v in ent.attributes.iteritems():
for k,v in ent.attributes.items():
if DEBUG: print("parsing attribute: ",k," value ",v)
if isinstance(v,str):
val = self.__clean__(v)
@@ -1754,7 +1754,7 @@ class IfcDocument:
elif isinstance(ref,str):
l = []
ref = ref.upper()
for k,ob in self.Entities.iteritems():
for k,ob in self.Entities.items():
if hasattr(ob,"type"):
if ob.type == ref:
l.append(ob)
@@ -1765,7 +1765,7 @@ class IfcDocument:
"searches entities types for partial match"
l = []
pat = pat.upper()
for k,ob in self.Entities.iteritems():
for k,ob in self.Entities.items():
if hasattr(ob,"type"):
if pat in ob.type:
if not ob.type in l: