mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
black format
This commit is contained in:
@@ -554,7 +554,7 @@ class Scheduler:
|
||||
text_params["font-style"] = "italic"
|
||||
if text_color:
|
||||
text_params["fill"] = text_color
|
||||
|
||||
|
||||
text_params["class_"] = "schedule"
|
||||
|
||||
if len(text_lines) == 1 and not wrap_text:
|
||||
|
||||
@@ -295,7 +295,6 @@ class Cost(bonsai.core.tool.Cost):
|
||||
unit = cls.get_quantity_unit_symbol(quantity)
|
||||
return selected_quantitites, unit
|
||||
|
||||
|
||||
@classmethod
|
||||
def get_assigned_product(cls, cost_item, quantity):
|
||||
assigned_products = cls.get_cost_item_assignments(cost_item, filter_by_type="PRODUCT", is_deep=False)
|
||||
@@ -868,11 +867,7 @@ class Cost(bonsai.core.tool.Cost):
|
||||
bpy.ops.bim.connect_websocket_server(page="costing")
|
||||
cost_schedule_data = cls.create_cost_schedule_json(cost_chedule)
|
||||
tool.Web.send_webui_data(
|
||||
data={
|
||||
"cost_items": cost_schedule_data,
|
||||
"cost_schedule_id": cost_chedule.id(),
|
||||
"currency": cls.currency()
|
||||
},
|
||||
data={"cost_items": cost_schedule_data, "cost_schedule_id": cost_chedule.id(), "currency": cls.currency()},
|
||||
data_key="cost_items",
|
||||
event="cost_items",
|
||||
)
|
||||
@@ -886,7 +881,11 @@ class Cost(bonsai.core.tool.Cost):
|
||||
if not cost_item:
|
||||
return results
|
||||
results["quantity_type"] = cost_item.CostQuantities[0].is_a() if cost_item.CostQuantities else None
|
||||
unit = ifcopenshell.util.unit.get_property_unit(cost_item.CostQuantities[0], tool.Ifc.get()) if cost_item.CostQuantities else None
|
||||
unit = (
|
||||
ifcopenshell.util.unit.get_property_unit(cost_item.CostQuantities[0], tool.Ifc.get())
|
||||
if cost_item.CostQuantities
|
||||
else None
|
||||
)
|
||||
if unit:
|
||||
results["unit_symbol"] = ifcopenshell.util.unit.get_unit_symbol(unit)
|
||||
for quantity in cost_item.CostQuantities or []:
|
||||
@@ -897,4 +896,3 @@ class Cost(bonsai.core.tool.Cost):
|
||||
if results["quantity_type"] == "IfcQuantityCount":
|
||||
results["unit_symbol"] = "U"
|
||||
return results
|
||||
|
||||
|
||||
@@ -476,7 +476,9 @@ class Web(bonsai.core.tool.Web):
|
||||
cls.load_cost_schedule_web_ui(cost_schedule)
|
||||
cls.enableEditingCostItemQuantities(cost_item)
|
||||
if operator_data["type"] == "deleteCostItemQuantity":
|
||||
bpy.ops.bim.remove_cost_item_quantity(cost_item=operator_data["costItemId"], physical_quantity=operator_data["quantityId"])
|
||||
bpy.ops.bim.remove_cost_item_quantity(
|
||||
cost_item=operator_data["costItemId"], physical_quantity=operator_data["quantityId"]
|
||||
)
|
||||
cost_item_id = operator_data["costItemId"]
|
||||
cost_item = ifc_file.by_id(cost_item_id)
|
||||
cost_schedule = tool.Cost.get_cost_schedule(cost_item)
|
||||
@@ -506,7 +508,6 @@ class Web(bonsai.core.tool.Web):
|
||||
event="quantities",
|
||||
)
|
||||
|
||||
|
||||
@classmethod
|
||||
def selection_data(cls, cost_item, elements):
|
||||
if not elements:
|
||||
|
||||
Reference in New Issue
Block a user