From a65a34cfe7de9de5dae591018b57571de4ce03e1 Mon Sep 17 00:00:00 2001 From: atom3 Date: Fri, 30 Apr 2021 00:09:04 +0200 Subject: [PATCH] code formatting --- src/ifcopenshell-python/ifcopenshell/ids.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/ids.py b/src/ifcopenshell-python/ifcopenshell/ids.py index eaa4537808..d3340cf720 100644 --- a/src/ifcopenshell-python/ifcopenshell/ids.py +++ b/src/ifcopenshell-python/ifcopenshell/ids.py @@ -55,7 +55,6 @@ class facet(metaclass=meta_facet): try: v = self.node.getElementsByTagName(k)[0] elems = [n for n in v.childNodes if n.nodeType == n.ELEMENT_NODE] - if elems: return restriction(elems[0]) else: @@ -91,7 +90,7 @@ class entity(facet): else: self.message = "an entity name '%(name)s'" return facet_evaluation(inst.is_a(self.name), self.message % {"name": inst.is_a()}) - + class classification(facet): """ @@ -221,10 +220,8 @@ class restriction: self.type = "length" elif n.nodeType == n.ELEMENT_NODE and n.tagName.endswith("pattern"): self.options.append(n.getAttribute("value")) - self.type = "pattern" + self.type = "pattern" - # "Given an instance with %(applicability)s\nWe expect %(requirements)s" % self.__dict__ - def __eq__(self, other): return other in self.options @@ -253,7 +250,7 @@ class specification: return [cls(n) for cls, n in zip(classes, children)] phrases = [n for n in node.childNodes if n.nodeType == n.ELEMENT_NODE] - + len(phrases) == 2 or error("expected two child nodes for ") phrases[0].tagName == "applicability" or error("expected ") phrases[1].tagName == "requirements" or error("expected ") @@ -290,8 +287,8 @@ class ids: def validate(self, ifc_file, logger): for spec in self.specifications: for elem in ifc_file.by_type("IfcObject"): - spec(elem, logger) - + spec(elem, logger) + if __name__ == "__main__": import sys, os import logging