mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-30 16:43:00 +00:00
typing
This commit is contained in:
@@ -25,6 +25,7 @@ import shutil
|
||||
import mathutils
|
||||
import xml.etree.ElementTree as ET
|
||||
import svgwrite
|
||||
import svgwrite.text
|
||||
import ifcopenshell
|
||||
import ifcopenshell.util.element
|
||||
import ifcopenshell.util.representation
|
||||
@@ -774,7 +775,7 @@ class SvgWriter:
|
||||
"text-anchor": text_anchor,
|
||||
}
|
||||
|
||||
def add_fill_bg(self, element, copy=True):
|
||||
def add_fill_bg(self, element: svgwrite.text.Text, copy: bool = True) -> svgwrite.text.Text:
|
||||
if copy:
|
||||
element = element.copy()
|
||||
if hasattr(element, "xml"):
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import bpy
|
||||
import bonsai.bim.helper
|
||||
from bpy.types import Panel, UIList
|
||||
from bonsai.bim.ifc import IfcStore
|
||||
from bonsai.bim.module.resource.data import ResourceData
|
||||
from typing import Any
|
||||
|
||||
|
||||
class BIM_PT_resources(Panel):
|
||||
@@ -287,7 +289,7 @@ class BIM_PT_resources(Panel):
|
||||
if self.props.cost_value_editing_type == "ATTRIBUTES":
|
||||
bonsai.bim.helper.draw_attributes(self.props.cost_value_attributes, self.layout.box())
|
||||
|
||||
def draw_readonly_cost_value_ui(self, layout, cost_value):
|
||||
def draw_readonly_cost_value_ui(self, layout: bpy.types.UILayout, cost_value: dict[str, Any]) -> None:
|
||||
if self.props.active_cost_value_id == cost_value["id"] and self.props.cost_value_editing_type == "FORMULA":
|
||||
layout.prop(self.props, "cost_value_formula", text="")
|
||||
else:
|
||||
@@ -295,7 +297,7 @@ class BIM_PT_resources(Panel):
|
||||
|
||||
self.draw_cost_value_operator_ui(layout, cost_value["id"], self.props.active_resource_id)
|
||||
|
||||
def draw_cost_value_operator_ui(self, layout, cost_value_id, parent_id):
|
||||
def draw_cost_value_operator_ui(self, layout: bpy.types.UILayout, cost_value_id: int, parent_id: int) -> None:
|
||||
if self.props.active_cost_value_id and self.props.active_cost_value_id == cost_value_id:
|
||||
if self.props.cost_value_editing_type == "ATTRIBUTES":
|
||||
op = layout.operator("bim.edit_resource_cost_value", text="", icon="CHECKMARK")
|
||||
|
||||
Reference in New Issue
Block a user