bsdd - check keyword length only in tool

just to make it more straightforward and remove unused output
This commit is contained in:
Andrej730
2024-07-26 10:48:29 +05:00
parent c9affcc622
commit 4aa3ffb765
2 changed files with 1 additions and 5 deletions
-2
View File
@@ -47,8 +47,6 @@ def load_bsdd(client: bsdd.Client, bsdd: tool.Bsdd) -> None:
def search_class(keyword: str, client: bsdd.Client, bsdd: tool.Bsdd) -> int:
bsdd.clear_classes()
if len(keyword) < 3:
return 0
related_entities = bsdd.get_related_ifc_entities(keyword)
active_dictionary_uri = bsdd.get_active_dictionary_uri()
classes = bsdd.search_class(client, keyword, [active_dictionary_uri], related_entities)
+1 -3
View File
@@ -112,10 +112,8 @@ class Bsdd(blenderbim.core.tool.Bsdd):
def get_related_ifc_entities(cls, keyword: str) -> list[str]:
active_object = bpy.context.active_object
related_ifc_entities = []
# TODO: keyword length seems to be already double-checked in core.
# And {"FINISHED"} return value is never used.
if len(keyword) < 3:
return {"FINISHED"}
return []
if cls.should_filter_ifc_class() and active_object:
element = tool.Ifc.get_entity(active_object)
if element: