mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 19:02:26 +00:00
stream - add support of crlf files
This commit is contained in:
@@ -157,6 +157,7 @@ try:
|
|||||||
exclude = set()
|
exclude = set()
|
||||||
|
|
||||||
offset = 0
|
offset = 0
|
||||||
|
newline_character = len(os.linesep)
|
||||||
for line in self.file:
|
for line in self.file:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line.startswith("#"):
|
if line.startswith("#"):
|
||||||
@@ -165,7 +166,7 @@ try:
|
|||||||
ifc_class = ifc_class.strip()
|
ifc_class = ifc_class.strip()
|
||||||
|
|
||||||
if ifc_class in exclude:
|
if ifc_class in exclude:
|
||||||
offset += len(line) + 1 # +1 for the newline character
|
offset += len(line) + newline_character
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for reference_id in self.reference_pattern.findall(line[1:]):
|
for reference_id in self.reference_pattern.findall(line[1:]):
|
||||||
@@ -180,7 +181,7 @@ try:
|
|||||||
for ifc_class in exclude_classes:
|
for ifc_class in exclude_classes:
|
||||||
declaration = self.ifc_schema.declaration_by_name(ifc_class)
|
declaration = self.ifc_schema.declaration_by_name(ifc_class)
|
||||||
exclude.update([st.name().upper() for st in ifcopenshell.util.schema.get_subtypes(declaration)])
|
exclude.update([st.name().upper() for st in ifcopenshell.util.schema.get_subtypes(declaration)])
|
||||||
offset += len(line) + 1 # +1 for the newline character
|
offset += len(line) + newline_character
|
||||||
|
|
||||||
self.preprocess_schema()
|
self.preprocess_schema()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user