mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
sql, stream - provide schema_identifier to avoid errors
This commit is contained in:
@@ -87,8 +87,6 @@ try:
|
||||
return (int(items[0]), str(items[1]), items[2])
|
||||
|
||||
class stream(file):
|
||||
schema: ifcopenshell.util.schema.IFC_SCHEMA = "IFC4"
|
||||
|
||||
def __init__(self, filepath: str):
|
||||
self.wrapped_data = None
|
||||
self.history_size = 64
|
||||
@@ -176,7 +174,7 @@ try:
|
||||
self.class_map.setdefault(ifc_class, []).append(step_id)
|
||||
self.id_offset[step_id] = offset
|
||||
elif line.startswith("FILE_SCHEMA"):
|
||||
self.schema = line.split("'")[1]
|
||||
self._schema = line.split("'")[1]
|
||||
self.ifc_schema = ifcopenshell.schema_by_name(self.schema)
|
||||
for ifc_class in exclude_classes:
|
||||
declaration = self.ifc_schema.declaration_by_name(ifc_class)
|
||||
@@ -290,6 +288,15 @@ try:
|
||||
# Override to avoid clean up unrelated to stream file.
|
||||
pass
|
||||
|
||||
@property
|
||||
def schema(self) -> ifcopenshell.util.schema.IFC_SCHEMA:
|
||||
return self._schema
|
||||
|
||||
@property
|
||||
def schema_identifier(self) -> str:
|
||||
# The best option we've got for mimicing `file.schema_identifier`.
|
||||
return self._schema
|
||||
|
||||
class stream_entity(entity_instance):
|
||||
stream_wrapper: stream_wrapper
|
||||
|
||||
|
||||
Reference in New Issue
Block a user