mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
typing
This commit is contained in:
@@ -33,7 +33,7 @@ from pytest_bdd import scenarios, given, when, then, parsers
|
||||
from mathutils import Vector
|
||||
from math import radians
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
from typing import Union, Any
|
||||
|
||||
scenarios("feature")
|
||||
|
||||
@@ -49,18 +49,18 @@ webbrowser.open = lambda x: True
|
||||
|
||||
|
||||
class PanelSpy:
|
||||
def __init__(self, panel):
|
||||
def __init__(self, panel: type[bpy.types.Panel]):
|
||||
self.is_spy_dirty = True
|
||||
self.panel = panel
|
||||
|
||||
def refresh_spy(self):
|
||||
if self.is_spy_dirty:
|
||||
self.is_spy_dirty = False
|
||||
self.spied_attr = None
|
||||
self.spied_labels = []
|
||||
self.spied_props = []
|
||||
self.spied_operators = []
|
||||
self.spied_lists = []
|
||||
self.spied_attr: Union[str, None] = None
|
||||
self.spied_labels: list[str] = []
|
||||
self.spied_props: list[dict[str, Any]] = []
|
||||
self.spied_operators: list[dict[str, Any]] = []
|
||||
self.spied_lists: list[dict[str, Any]] = []
|
||||
self.panel.draw(self, bpy.context)
|
||||
|
||||
def __getattr__(self, attr):
|
||||
@@ -91,6 +91,7 @@ class PanelSpy:
|
||||
return self
|
||||
elif self.spied_attr == "prop":
|
||||
props, name = args
|
||||
props: bpy.types.bpy_struct
|
||||
text = kwargs.get("text", props.bl_rna.properties[name].name)
|
||||
icon = kwargs.get("icon", None)
|
||||
prop_type = props.bl_rna.properties[name].type
|
||||
@@ -152,7 +153,7 @@ class TemplateListSpy:
|
||||
|
||||
|
||||
panel_name_cache = {}
|
||||
panel_spy = None
|
||||
panel_spy: PanelSpy = None
|
||||
|
||||
|
||||
def replace_variables(value):
|
||||
|
||||
Reference in New Issue
Block a user