From fe0a98a44fedb7ffdc86a10f26928122b5bf983d Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 16 Mar 2023 16:06:41 +0500 Subject: [PATCH] black format --- src/blenderbim/blenderbim/bim/helper.py | 4 ++-- .../blenderbim/bim/module/drawing/operator.py | 4 ++-- src/blenderbim/blenderbim/bim/module/drawing/prop.py | 4 ++-- src/blenderbim/blenderbim/bim/module/drawing/ui.py | 1 - .../blenderbim/bim/module/model/workspace.py | 12 +++--------- src/blenderbim/blenderbim/tool/drawing.py | 1 - 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/helper.py b/src/blenderbim/blenderbim/bim/helper.py index ef74fbfedb..d0b19c6d1c 100644 --- a/src/blenderbim/blenderbim/bim/helper.py +++ b/src/blenderbim/blenderbim/bim/helper.py @@ -32,11 +32,11 @@ from blenderbim.bim.ifc import IfcStore def draw_attributes(props, layout, copy_operator=None, popup_active_attribute=None): - """you can set attribute active in popup with `active_attribute` + """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 """ - for attribute in props: + for attribute in props: row = layout.row(align=True) if attribute == popup_active_attribute: row.activate_init = True diff --git a/src/blenderbim/blenderbim/bim/module/drawing/operator.py b/src/blenderbim/blenderbim/bim/module/drawing/operator.py index d1a6ff0eed..ac4491b13d 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/operator.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/operator.py @@ -1392,7 +1392,7 @@ class EditTextPopup(bpy.types.Operator): split = rows[i].split(factor=0.1, align=False) split.column() split.label(text=text_lines[i]) - + def cancel(self, context): # disable editing when dialog is closed bpy.ops.bim.disable_editing_text() @@ -1407,7 +1407,7 @@ class EditTextPopup(bpy.types.Operator): return context.window_manager.invoke_props_dialog(self) else: bpy.ops.bim.edit_text() - return {'FINISHED'} + return {"FINISHED"} class EditText(bpy.types.Operator, Operator): diff --git a/src/blenderbim/blenderbim/bim/module/drawing/prop.py b/src/blenderbim/blenderbim/bim/module/drawing/prop.py index 26663e1dbe..7eb077c5aa 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/prop.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/prop.py @@ -424,7 +424,7 @@ class BIMTextProperties(PropertyGroup): attributes: CollectionProperty(name="Attributes", type=Attribute) test_prop: StringProperty(name="test_prop", default="TEXT") # Current text value with evaluated experessions stored in `value`. - # The original (Literal) value stored in `attributes['Literal']` + # The original (Literal) value stored in `attributes['Literal']` # and can be accessed with `get_text()` value: StringProperty(name="Value", default="TEXT") font_size: EnumProperty( @@ -444,7 +444,7 @@ class BIMTextProperties(PropertyGroup): ) def get_text(self): - text_attribute = self.attributes.get('Literal', None) + text_attribute = self.attributes.get("Literal", None) return text_attribute.string_value if text_attribute else self.text diff --git a/src/blenderbim/blenderbim/bim/module/drawing/ui.py b/src/blenderbim/blenderbim/bim/module/drawing/ui.py index de4d23da86..99e06f19dc 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/ui.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/ui.py @@ -385,7 +385,6 @@ class BIM_PT_text(Panel): row.label(text=props.value) - class BIM_PT_annotation_utilities(Panel): bl_idname = "BIM_PT_annotation_utilities" bl_label = "Annotation" diff --git a/src/blenderbim/blenderbim/bim/module/model/workspace.py b/src/blenderbim/blenderbim/bim/module/model/workspace.py index 87b0ec06d6..14286d5426 100644 --- a/src/blenderbim/blenderbim/bim/module/model/workspace.py +++ b/src/blenderbim/blenderbim/bim/module/model/workspace.py @@ -334,14 +334,11 @@ class BimToolUI: row.label(text="", icon="EVENT_SHIFT") row.label(text="", icon="EVENT_E") row.operator("bim.hotkey", text="Edit Roof Path").hotkey = "S_E" - elif ( - (TextData.is_loaded or not TextData.load()) - and TextData.data["attributes"] - ): + elif (TextData.is_loaded or not TextData.load()) and TextData.data["attributes"]: row = cls.layout.row(align=True) row.label(text="", icon="EVENT_SHIFT") row.label(text="", icon="EVENT_E") - row.operator("bim.hotkey", text="Edit text").hotkey = "S_E" + row.operator("bim.hotkey", text="Edit text").hotkey = "S_E" row = cls.layout.row(align=True) row.label(text="", icon="EVENT_SHIFT") @@ -577,10 +574,7 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator): bpy.context.object.select_set(True) bpy.ops.bim.enable_editing_roof_path() - elif ( - (TextData.is_loaded or not TextData.load()) - and TextData.data["attributes"] - ): + elif (TextData.is_loaded or not TextData.load()) and TextData.data["attributes"]: bpy.context.object.select_set(True) bpy.ops.bim.edit_text_popup() diff --git a/src/blenderbim/blenderbim/tool/drawing.py b/src/blenderbim/blenderbim/tool/drawing.py index 04cf2a0327..9cd08fa05d 100644 --- a/src/blenderbim/blenderbim/tool/drawing.py +++ b/src/blenderbim/blenderbim/tool/drawing.py @@ -564,7 +564,6 @@ class Drawing(blenderbim.core.tool.Drawing): # or if the current font size is not present in classes # (except regular font size because it's default) if different_font_sizes or (font_size_str not in classes_split and font_size_str != "regular"): - classes_split = [c for c in classes_split if c not in FONT_SIZES] + [font_size_str] classes = " ".join(classes_split)