This commit is contained in:
Andrej730
2024-09-20 11:34:05 +05:00
parent d7adec3d54
commit 9953ce1b39
4 changed files with 18 additions and 10 deletions
+9 -2
View File
@@ -32,7 +32,12 @@ from bonsai.bim.ifc import IfcStore
from typing import Optional, Callable, Any, Union
def draw_attributes(props, layout, copy_operator=None, popup_active_attribute=None):
def draw_attributes(
props: list[bpy.types.PropertyGroup],
layout: bpy.types.UILayout,
copy_operator: Optional[str] = None,
popup_active_attribute: Optional[bpy.types.PropertyGroup] = None,
) -> None:
"""you can set attribute active in popup with `active_attribute`
meaning you will be able to type into attribute's field without having to click
on it first
@@ -44,7 +49,9 @@ def draw_attributes(props, layout, copy_operator=None, popup_active_attribute=No
draw_attribute(attribute, row, copy_operator)
def draw_attribute(attribute, layout, copy_operator=None):
def draw_attribute(
attribute: bpy.types.PropertyGroup, layout: bpy.types.UILayout, copy_operator: Optional[str] = None
) -> None:
value_name = attribute.get_value_name()
if not value_name:
layout.label(text=attribute.name)
@@ -16,6 +16,7 @@
# 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
import bonsai.tool as tool
import bonsai.bim.module.classification.prop as classification_prop
@@ -116,6 +117,8 @@ class BIM_PT_classifications(Panel):
class ReferenceUI:
layout: bpy.types.UILayout
def draw_ui(self, context):
obj = context.active_object
self.sprops = context.scene.BIMClassificationProperties
+2 -2
View File
@@ -2,7 +2,7 @@ import os
import sys
def find_whl_files(directory):
def find_whl_files(directory: str) -> list[str]:
whl_files = []
for root, dirs, files in os.walk(directory):
for file in files:
@@ -12,7 +12,7 @@ def find_whl_files(directory):
return whl_files
def update_pyproject_toml(pyproject_path, whl_files):
def update_pyproject_toml(pyproject_path: str, whl_files: list[str]) -> None:
with open(pyproject_path, "a") as f:
f.write("\nwheels = [\n")
for whl in whl_files: