WIP: white space changes to BoltFactory to fix flake8 #105083

Draft
sw-tya wants to merge 3 commits from sw-tya/blender-addons:flake8_bolts into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit e2afa84d7c - Show all commits

View File

@ -26,15 +26,14 @@ class add_mesh_bolt(Operator, AddObjectHelper):
bl_options = {'REGISTER', 'UNDO', 'PRESET'}
bl_description = "Construct many types of Bolts"
MAX_INPUT_NUMBER = 50
Bolt : BoolProperty(name = "Bolt",
default = True,
description = "Bolt")
change : BoolProperty(name = "Change",
default = False,
description = "change Bolt")
Bolt: BoolProperty(name="Bolt",
default=True,
description="Bolt")
change: BoolProperty(name="Change",
default=False,
description="change Bolt")
# Model Types
Model_Type_List = [('bf_Model_Bolt', 'BOLT', 'Bolt Model'),
@ -168,7 +167,7 @@ class add_mesh_bolt(Operator, AddObjectHelper):
bf_12_Point_Head_Flat_Distance: FloatProperty(
attr='bf_12_Point_Head_Flat_Distance',
name='Flat Dist', default=3.0,
min=0.001, soft_min=0, #limit to 0.001 to avoid calculation error
min=0.001, soft_min=0, # limit to 0.001 to avoid calculation error
max=MAX_INPUT_NUMBER,
description='Flat Distance of the 12 Point Head',
unit='LENGTH',
@ -327,6 +326,7 @@ class add_mesh_bolt(Operator, AddObjectHelper):
description='Flange diameter of the 12 point Nut',
unit='LENGTH',
)
def draw(self, context):
layout = self.layout
col = layout.column()
@ -387,8 +387,6 @@ class add_mesh_bolt(Operator, AddObjectHelper):
col.prop(self, 'bf_Hex_Nut_Height')
col.prop(self, 'bf_Hex_Nut_Flat_Distance')
# Thread
col.label(text='Thread')
if self.bf_Model_Type == 'bf_Model_Bolt':
@ -467,6 +465,7 @@ class add_mesh_bolt(Operator, AddObjectHelper):
return {'FINISHED'}
# Register:
def Bolt_contex_menu(self, context):
bl_label = 'Change'
@ -481,18 +480,19 @@ def Bolt_contex_menu(self, context):
setattr(props, prm, obj.data[prm])
layout.separator()
def menu_func_bolt(self, context):
layout = self.layout
layout.separator()
oper = self.layout.operator(add_mesh_bolt.bl_idname, text="Bolt", icon="MOD_SCREW")
oper.change = False
classes = (
add_mesh_bolt,
)
def register():
for cls in classes:
bpy.utils.register_class(cls)
@ -506,6 +506,7 @@ def unregister():
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
def BoltParameters():
BoltParameters = [
"bf_Model_Type",