mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
authorisation -> authorization in header schema for compatibility
This commit is contained in:
@@ -51,12 +51,12 @@ def create_file(version: ifcopenshell.util.schema.IFC_SCHEMA = "IFC4") -> ifcope
|
||||
# ... and off we go!
|
||||
"""
|
||||
file = ifcopenshell.file(schema=version)
|
||||
file.wrapped_data.header.file_name.name = "/dev/null" # Hehehe
|
||||
file.wrapped_data.header.file_name.time_stamp = (
|
||||
file.header.file_name.name = "/dev/null" # Hehehe
|
||||
file.header.file_name.time_stamp = (
|
||||
datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc).astimezone().replace(microsecond=0).isoformat()
|
||||
)
|
||||
file.wrapped_data.header.file_name.preprocessor_version = "IfcOpenShell {}".format(ifcopenshell.version)
|
||||
file.wrapped_data.header.file_name.originating_system = "IfcOpenShell {}".format(ifcopenshell.version)
|
||||
file.wrapped_data.header.file_name.authorization = "Nobody"
|
||||
file.wrapped_data.header.file_description.description = ("ViewDefinition[DesignTransferView]",)
|
||||
file.header.file_name.preprocessor_version = "IfcOpenShell {}".format(ifcopenshell.version)
|
||||
file.header.file_name.originating_system = "IfcOpenShell {}".format(ifcopenshell.version)
|
||||
file.header.file_name.authorization = "Nobody"
|
||||
file.header.file_description.description = ("ViewDefinition[DesignTransferView]",)
|
||||
return file
|
||||
|
||||
@@ -793,3 +793,9 @@ class file:
|
||||
|
||||
def to_string(self) -> str:
|
||||
return self.wrapped_data.to_string()
|
||||
|
||||
@property
|
||||
def header(self):
|
||||
h = self.wrapped_data.header()
|
||||
object.__setattr__(h, "file_ref", lambda inst: entity_instance.wrap_value(inst, file=self))
|
||||
return h
|
||||
|
||||
@@ -26,9 +26,9 @@ class TestCreateFile(test.bootstrap.IFC4):
|
||||
assert ifc.schema == "IFC4"
|
||||
ifc = ifcopenshell.api.project.create_file(version="IFC2X3")
|
||||
assert ifc.schema == "IFC2X3"
|
||||
assert ifc.wrapped_data.header.file_name.name == "/dev/null"
|
||||
assert ifc.wrapped_data.header.file_name.time_stamp
|
||||
assert "IfcOpenShell" in ifc.wrapped_data.header.file_name.preprocessor_version
|
||||
assert "IfcOpenShell" in ifc.wrapped_data.header.file_name.originating_system
|
||||
assert ifc.wrapped_data.header.file_name.authorization == "Nobody"
|
||||
assert ifc.wrapped_data.header.file_description.description == ("ViewDefinition[DesignTransferView]",)
|
||||
assert ifc.header.file_name.name == "/dev/null"
|
||||
assert ifc.header.file_name.time_stamp
|
||||
assert "IfcOpenShell" in ifc.header.file_name.preprocessor_version
|
||||
assert "IfcOpenShell" in ifc.header.file_name.originating_system
|
||||
assert ifc.header.file_name.authorization == "Nobody"
|
||||
assert ifc.header.file_description.description == ("ViewDefinition[DesignTransferView]",)
|
||||
|
||||
@@ -111,7 +111,7 @@ def test_bug_2486_a():
|
||||
|
||||
def test_bug_2486_b():
|
||||
file = ifcopenshell.template.create()
|
||||
file.wrapped_data.header.file_name.name = "myfile.ifc"
|
||||
file.header.file_name.name = "myfile.ifc"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user