mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Run black, and add black to a "qa" target to make it a standardised process.
This commit is contained in:
@@ -25,11 +25,12 @@ class Usecase:
|
||||
# https://forums.buildingsmart.org/t/what-are-allowed-to-be-root-level-construction-resources/3550
|
||||
if self.settings["parent_resource"]:
|
||||
ifcopenshell.api.run(
|
||||
"nest.assign_object", self.file, related_object=resource, relating_object=self.settings["parent_resource"]
|
||||
"nest.assign_object",
|
||||
self.file,
|
||||
related_object=resource,
|
||||
relating_object=self.settings["parent_resource"],
|
||||
)
|
||||
else:
|
||||
context = self.file.by_type("IfcContext")[0]
|
||||
ifcopenshell.api.run(
|
||||
"project.assign_declaration", self.file, definition=resource, relating_context=context
|
||||
)
|
||||
ifcopenshell.api.run("project.assign_declaration", self.file, definition=resource, relating_context=context)
|
||||
return resource
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import ifcopenshell.util.date
|
||||
|
||||
|
||||
class Usecase:
|
||||
def __init__(self, file, **settings):
|
||||
self.file = file
|
||||
|
||||
@@ -23,7 +23,7 @@ class Data(CostValueTrait):
|
||||
return
|
||||
cls.load_resources()
|
||||
cls.load_resource_times()
|
||||
cls.is_loaded=True
|
||||
cls.is_loaded = True
|
||||
|
||||
@classmethod
|
||||
def load_resources(cls):
|
||||
@@ -63,6 +63,6 @@ class Data(CostValueTrait):
|
||||
continue
|
||||
if "Start" in key or "Finish" in key or key == "StatusTime":
|
||||
data[key] = ifcopenshell.util.date.ifc2datetime(value)
|
||||
elif "Work" in key or key =="LevelingDelay":
|
||||
elif "Work" in key or key == "LevelingDelay":
|
||||
data[key] = ifcopenshell.util.date.ifc2datetime(value)
|
||||
cls.resource_times[resource_time.id()] = data
|
||||
|
||||
@@ -18,10 +18,7 @@ class Usecase:
|
||||
and "ScheduleFinish" in self.settings["attributes"].keys()
|
||||
):
|
||||
del self.settings["attributes"]["ScheduleFinish"]
|
||||
if (
|
||||
self.settings["attributes"].get("ActualWork", None)
|
||||
and "ActualFinish" in self.settings["attributes"].keys()
|
||||
):
|
||||
if self.settings["attributes"].get("ActualWork", None) and "ActualFinish" in self.settings["attributes"].keys():
|
||||
del self.settings["attributes"]["ActualFinish"]
|
||||
|
||||
for name, value in self.settings["attributes"].items():
|
||||
|
||||
Reference in New Issue
Block a user