mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
by_guid() and unicode in py2
This commit is contained in:
@@ -40,8 +40,8 @@ class file(object):
|
|||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
if isinstance(key, numbers.Integral):
|
if isinstance(key, numbers.Integral):
|
||||||
return entity_instance(self.wrapped_data.by_id(key))
|
return entity_instance(self.wrapped_data.by_id(key))
|
||||||
elif isinstance(key, str):
|
elif isinstance(key, basestring):
|
||||||
return entity_instance(self.wrapped_data.by_guid(key))
|
return entity_instance(self.wrapped_data.by_guid(str(key)))
|
||||||
def by_id(self, id): return self[id]
|
def by_id(self, id): return self[id]
|
||||||
def by_guid(self, guid): return self[guid]
|
def by_guid(self, guid): return self[guid]
|
||||||
def add(self, inst):
|
def add(self, inst):
|
||||||
|
|||||||
Reference in New Issue
Block a user