From 92528d84cdd0eb7c5e456541049de3d6c26110bb Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 14 Jul 2026 16:42:04 +0500 Subject: [PATCH] express: clean up trailing spaces --- .../ifcopenshell/express/bootstrap.py | 4 +- .../ifcopenshell/express/express_parser.py | 4 +- .../ifcopenshell/express/header_schema.exp | 6 +-- .../ifcopenshell/express/rule_compiler.py | 4 +- .../ifcopenshell/express/run.bat | 50 +++++++++---------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/express/bootstrap.py b/src/ifcopenshell-python/ifcopenshell/express/bootstrap.py index 8c0e7e00d7..9abc785d5f 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/bootstrap.py +++ b/src/ifcopenshell-python/ifcopenshell/express/bootstrap.py @@ -237,7 +237,7 @@ def parse(fn: str) -> mapping.Mapping: if os.path.exists(cache_file) and os.path.getmtime(cache_file) >= os.path.getmtime(fn): with open(cache_file, "rb") as f: m = pickle.load(f) - else: + else: %s syntax.ignore("--" + restOfLine) @@ -249,7 +249,7 @@ def parse(fn: str) -> mapping.Mapping: with open(cache_file, "wb") as f: pickle.dump(m, f, protocol=0) return m - + if __name__ == "__main__": m = parse(sys.argv[1]) import importlib diff --git a/src/ifcopenshell-python/ifcopenshell/express/express_parser.py b/src/ifcopenshell-python/ifcopenshell/express/express_parser.py index 7e447a43c6..cf546c3e14 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/express_parser.py +++ b/src/ifcopenshell-python/ifcopenshell/express/express_parser.py @@ -17,7 +17,7 @@ def parse(fn: str) -> mapping.Mapping: if os.path.exists(cache_file) and os.path.getmtime(cache_file) >= os.path.getmtime(fn): with open(cache_file, "rb") as f: m = pickle.load(f) - else: + else: ABS = (CaselessKeyword("abs")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABS"))("ABS") ABSTRACT = (CaselessKeyword("abstract")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ABSTRACT"))("ABSTRACT") ACOS = (CaselessKeyword("acos")).setParseAction(lambda s, loc, t: Node(s, loc, t, rule="ACOS"))("ACOS") @@ -479,7 +479,7 @@ def parse(fn: str) -> mapping.Mapping: with open(cache_file, "wb") as f: pickle.dump(m, f, protocol=0) return m - + if __name__ == "__main__": m = parse(sys.argv[1]) import importlib diff --git a/src/ifcopenshell-python/ifcopenshell/express/header_schema.exp b/src/ifcopenshell-python/ifcopenshell/express/header_schema.exp index 0dba8dba60..370382216e 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/header_schema.exp +++ b/src/ifcopenshell-python/ifcopenshell/express/header_schema.exp @@ -11,16 +11,16 @@ ENTITY file_name; time_stamp : time_stamp_text; author : LIST [1:?] OF STRING (256); organization : LIST [1:?] OF STRING (256); - preprocessor_version : STRING (256); + preprocessor_version : STRING (256); originating_system : STRING (256); - authorisation : STRING (256); + authorisation : STRING (256); END_ENTITY; ENTITY file_description; description : LIST [1:?] OF STRING (256); implementation_level : STRING (256); END_ENTITY; - + ENTITY file_schema; schema_identifiers : LIST [1:?] OF UNIQUE schema_name; END_ENTITY; diff --git a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py index 44c7922758..e840e42334 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py +++ b/src/ifcopenshell-python/ifcopenshell/express/rule_compiler.py @@ -292,7 +292,7 @@ def process_rule_decl(context): class {context.rule_head.rule_id}: SCOPE = "file" - @staticmethod + @staticmethod def __call__(file): {context.rule_head.entity_ref} = file.by_type("{context.rule_head.entity_ref}") {indent(8, context.algorithm_head.local_decl)} @@ -335,7 +335,7 @@ class {class_name}_{domain_rule.rule_label_id}: TYPE_NAME = "{class_name}" RULE_NAME = "{domain_rule.rule_label_id}" - @staticmethod + @staticmethod def __call__(self): {indent(8, (f"{a.lower()} = self.{a}" for a in attributes if re.search(f'{wb}{a.lower()}{wb}', str(domain_rule))))} {indent(8, domain_rule)} diff --git a/src/ifcopenshell-python/ifcopenshell/express/run.bat b/src/ifcopenshell-python/ifcopenshell/express/run.bat index 96fd58973d..4a454e8a6d 100644 --- a/src/ifcopenshell-python/ifcopenshell/express/run.bat +++ b/src/ifcopenshell-python/ifcopenshell/express/run.bat @@ -4,12 +4,12 @@ IF EXIST IFC2X3_TC1.exp ( python express_parser.py IFC2X3_TC1.exp header implementation schema_class definitions - + IF EXIST Ifc2x3-schema.cpp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc2x3.cpp txt/header_ifc2x3.txt Ifc2x3.cpp python cat.py -o ..\..\..\ifcparse\Ifc2x3.h txt/header_ifc2x3.txt Ifc2x3.h - python cat.py -o ..\..\..\ifcparse\Ifc2x3-schema.cpp txt/header_ifc2x3.txt Ifc2x3-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc2x3-schema.cpp txt/header_ifc2x3.txt Ifc2x3-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc2x3-definitions.h txt/header_ifc2x3.txt Ifc2x3-definitions.h ) ELSE ( :: v0.5.0 @@ -19,7 +19,7 @@ IF EXIST IFC2X3_TC1.exp ( python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.cpp txt/header_ifc2x3.txt txt/ifndef_ifc4.txt Ifc2x3-latebound.cpp txt/endif.txt python cat.py -o ..\..\..\ifcparse\Ifc2x3-latebound.h txt/header_ifc2x3.txt Ifc2x3-latebound.h ) - + del *.cpp *.h ) @@ -30,7 +30,7 @@ IF EXIST IFC4_ADD2TC1.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4.cpp txt/header_ifc4.txt Ifc4.cpp python cat.py -o ..\..\..\ifcparse\Ifc4.h txt/header_ifc4.txt Ifc4.h - python cat.py -o ..\..\..\ifcparse\Ifc4-schema.cpp txt/header_ifc4.txt Ifc4-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4-schema.cpp txt/header_ifc4.txt Ifc4-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4-definitions.h txt/header_ifc4.txt Ifc4-definitions.h ) ELSE ( :: v0.5.0 @@ -40,7 +40,7 @@ IF EXIST IFC4_ADD2TC1.exp ( python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.cpp txt/header_ifc4.txt txt/ifdef_ifc4.txt Ifc4-latebound.cpp txt/endif.txt python cat.py -o ..\..\..\ifcparse\Ifc4-latebound.h txt/header_ifc4.txt Ifc4-latebound.h ) - + del *.cpp *.h ) @@ -51,10 +51,10 @@ IF EXIST IFC4x1.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x1.cpp txt/header_ifc4x1.txt Ifc4x1.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x1.h txt/header_ifc4x1.txt Ifc4x1.h - python cat.py -o ..\..\..\ifcparse\Ifc4x1-schema.cpp txt/header_ifc4x1.txt Ifc4x1-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x1-schema.cpp txt/header_ifc4x1.txt Ifc4x1-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x1-definitions.h txt/header_ifc4x1.txt Ifc4x1-definitions.h ) - + del *.cpp *.h ) @@ -65,10 +65,10 @@ IF EXIST IFC4x2.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x2.cpp txt/header_ifc4x2.txt Ifc4x2.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x2.h txt/header_ifc4x2.txt Ifc4x2.h - python cat.py -o ..\..\..\ifcparse\Ifc4x2-schema.cpp txt/header_ifc4x2.txt Ifc4x2-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x2-schema.cpp txt/header_ifc4x2.txt Ifc4x2-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x2-definitions.h txt/header_ifc4x2.txt Ifc4x2-definitions.h ) - + del *.cpp *.h ) @@ -79,10 +79,10 @@ IF EXIST IFC4x3_RC1.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-schema.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-schema.cpp txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc1-definitions.h txt/header_ifc4x3_rc1.txt Ifc4x3_rc1-definitions.h ) - + del *.cpp *.h ) @@ -93,10 +93,10 @@ IF EXIST IFC4x3_RC2.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc2-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc2-definitions.h ) - + del *.cpp *.h ) @@ -107,10 +107,10 @@ IF EXIST IFC4x3_RC3.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc3-definitions.h ) - + del *.cpp *.h ) @@ -121,10 +121,10 @@ IF EXIST IFC4x3_RC4.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_rc4-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3_rc4-definitions.h ) - + del *.cpp *.h ) @@ -135,10 +135,10 @@ IF EXIST IFC4X3.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3.cpp txt/header_ifc4x3_rc2.txt Ifc4x3.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3.h txt/header_ifc4x3_rc2.txt Ifc4x3.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3-schema.cpp txt/header_ifc4x3_rc2.txt Ifc4x3-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3-definitions.h txt/header_ifc4x3_rc2.txt Ifc4x3-definitions.h ) - + del *.cpp *.h ) @@ -149,10 +149,10 @@ IF EXIST IFC4X3_TC1.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-schema.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-schema.cpp txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_tc1-definitions.h txt/header_ifc4x3_tc1.txt Ifc4x3_tc1-definitions.h ) - + del *.cpp *.h ) @@ -163,10 +163,10 @@ IF EXIST IFC4X3_ADD1.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1.h txt/header_ifc4x3_add1.txt Ifc4x3_add1.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-schema.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-schema.cpp txt/header_ifc4x3_add1.txt Ifc4x3_add1-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_add1-definitions.h txt/header_ifc4x3_add1.txt Ifc4x3_add1-definitions.h ) - + del *.cpp *.h ) @@ -177,9 +177,9 @@ IF EXIST IFC4X3_ADD2.exp ( :: v0.6.0 python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2.h txt/header_ifc4x3_add2.txt Ifc4x3_add2.h - python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-schema.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2-schema.cpp + python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-schema.cpp txt/header_ifc4x3_add2.txt Ifc4x3_add2-schema.cpp python cat.py -o ..\..\..\ifcparse\Ifc4x3_add2-definitions.h txt/header_ifc4x3_add2.txt Ifc4x3_add2-definitions.h ) - + del *.cpp *.h )