mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 19:09:07 +00:00
Run black on express/
This commit is contained in:
@@ -27,6 +27,7 @@ if tuple(map(int, platform.python_version_tuple())) < (2, 7):
|
||||
|
||||
collections.OrderedDict = ordereddict.OrderedDict
|
||||
|
||||
|
||||
# According to ISO 10303-11 7.1.2: Letters: "... The case of
|
||||
# letters is significant only within explicit string literals."
|
||||
class OrderedCaseInsensitiveDict_KeyObject(str):
|
||||
@@ -92,23 +93,21 @@ class Schema:
|
||||
|
||||
sort = lambda d: OrderedCaseInsensitiveDict(sorted(d))
|
||||
|
||||
declarations = [
|
||||
d.any()[0]
|
||||
for d in schema_declarations
|
||||
if d.rule == "declaration"
|
||||
] + [
|
||||
d
|
||||
for d in schema_declarations
|
||||
if d.rule == "RuleDeclaration"
|
||||
declarations = [d.any()[0] for d in schema_declarations if d.rule == "declaration"] + [
|
||||
d for d in schema_declarations if d.rule == "RuleDeclaration"
|
||||
]
|
||||
|
||||
|
||||
self.types = sort([(t.name, t) for t in declarations if isinstance(t, nodes.TypeDeclaration)])
|
||||
self.entities = sort([(t.name, t) for t in declarations if isinstance(t, nodes.EntityDeclaration)])
|
||||
self.rules = sort([(t.name, t) for t in declarations if isinstance(t, nodes.RuleDeclaration)])
|
||||
self.functions = sort([(t.name, t) for t in declarations if isinstance(t, nodes.FunctionDeclaration)])
|
||||
|
||||
self.keys = list(self.types.keys()) + list(self.entities.keys()) + list(self.rules.keys()) + list(self.functions.keys())
|
||||
self.all_declarations = {k: v for d in (self.types, self.entities, self.rules, self.functions) for k, v in d.items()}
|
||||
self.keys = (
|
||||
list(self.types.keys()) + list(self.entities.keys()) + list(self.rules.keys()) + list(self.functions.keys())
|
||||
)
|
||||
self.all_declarations = {
|
||||
k: v for d in (self.types, self.entities, self.rules, self.functions) for k, v in d.items()
|
||||
}
|
||||
|
||||
of_type = lambda *types: sort(
|
||||
[(a, b.type) for a, b in self.types.items() if any(isinstance(b.type, ty) for ty in types)]
|
||||
|
||||
Reference in New Issue
Block a user