Run black, and add black to a "qa" target to make it a standardised process.

This commit is contained in:
Dion Moult
2021-09-09 21:27:23 +10:00
parent 95903c965d
commit 865c0f4895
305 changed files with 1968 additions and 1143 deletions
@@ -10,8 +10,11 @@ class Usecase:
self.settings[key] = value
def execute(self):
return self.file.create_entity("IfcGroup", **{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"Name": "Unnamed"
})
return self.file.create_entity(
"IfcGroup",
**{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"Name": "Unnamed",
}
)
@@ -14,12 +14,15 @@ class Usecase:
def execute(self):
if not self.settings["group"].IsGroupedBy:
return self.file.create_entity("IfcRelAssignsToGroup", **{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"RelatedObjects": [self.settings["product"]],
"RelatingGroup": self.settings["group"]
})
return self.file.create_entity(
"IfcRelAssignsToGroup",
**{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"RelatedObjects": [self.settings["product"]],
"RelatingGroup": self.settings["group"],
}
)
rel = self.settings["group"].IsGroupedBy[0]
related_objects = set(rel.RelatedObjects) or set()
related_objects.add(self.settings["product"])
@@ -21,4 +21,4 @@ class Data:
data = group.get_info()
del data["OwnerHistory"]
cls.groups[group.id()] = data
cls.is_loaded=True
cls.is_loaded = True
@@ -1,10 +1,7 @@
class Usecase:
def __init__(self, file, **settings):
self.file = file
self.settings = {
"group": None,
"attributes": {}
}
self.settings = {"group": None, "attributes": {}}
for key, value in settings.items():
self.settings[key] = value