Cleanup: single quote enums in Python

This commit is contained in:
Campbell Barton
2023-09-13 13:36:00 +10:00
parent 7eb0b6cce9
commit c51336f5e8
8 changed files with 25 additions and 26 deletions
@@ -87,17 +87,16 @@ def edit_geometry_nodes_modifier_poll(context):
def socket_idname_to_attribute_type(idname):
if idname.startswith("NodeSocketInt"):
return "INT"
return 'INT'
elif idname.startswith("NodeSocketColor"):
return "FLOAT_COLOR"
return 'FLOAT_COLOR'
elif idname.startswith("NodeSocketVector"):
return "FLOAT_VECTOR"
return 'FLOAT_VECTOR'
elif idname.startswith("NodeSocketBool"):
return "BOOLEAN"
return 'BOOLEAN'
elif idname.startswith("NodeSocketFloat"):
return "FLOAT"
return 'FLOAT'
raise ValueError("Unsupported socket type")
return ""
def modifier_attribute_name_get(modifier, identifier):
@@ -179,7 +178,7 @@ class MoveModifierToNodes(Operator):
first_geometry_input = group_node_input
if not first_geometry_input:
self.report({"WARNING"}, "Node group must have a geometry input")
self.report({'WARNING'}, "Node group must have a geometry input")
return {'CANCELLED'}
group.links.new(group_input_node.outputs[0], first_geometry_input)
@@ -226,8 +225,8 @@ class MoveModifierToNodes(Operator):
group.links.new(store_nodes[-1].outputs["Geometry"], group_output_node.inputs[data_("Geometry")])
else:
if not first_geometry_output:
self.report({"WARNING"}, "Node group must have a geometry output")
return {"CANCELLED"}
self.report({'WARNING'}, "Node group must have a geometry output")
return {'CANCELLED'}
group.links.new(first_geometry_output, group_output_node.inputs[data_("Geometry")])
modifier.node_group = group
@@ -107,8 +107,8 @@ class DATA_PT_lightprobe_eevee_next(DataButtonsPanel, Panel):
col.separator()
col.operator("object.lightprobe_cache_bake").subset = "ACTIVE"
col.operator("object.lightprobe_cache_free").subset = "ACTIVE"
col.operator("object.lightprobe_cache_bake").subset = 'ACTIVE'
col.operator("object.lightprobe_cache_free").subset = 'ACTIVE'
col.separator()
@@ -574,8 +574,8 @@ class ColorAttributesListBase():
for idx, item in enumerate(attributes):
skip = (
(item.domain not in {"POINT", "CORNER"}) or
(item.data_type not in {"FLOAT_COLOR", "BYTE_COLOR"}) or
(item.domain not in {'POINT', 'CORNER'}) or
(item.data_type not in {'FLOAT_COLOR', 'BYTE_COLOR'}) or
item.is_internal
)
flags[idx] = 0 if skip else flags[idx]
@@ -229,7 +229,7 @@ class AddModifierMenu(Operator):
def poll(cls, context):
# NOTE: This operator only exists to add a poll to the add modifier shortcut in the property editor.
space = context.space_data
return space and space.type == 'PROPERTIES' and space.context == "MODIFIER"
return space and space.type == 'PROPERTIES' and space.context == 'MODIFIER'
def invoke(self, context, event):
return bpy.ops.wm.call_menu(name="OBJECT_MT_modifier_add")
+4 -4
View File
@@ -651,7 +651,7 @@ class RENDER_PT_eevee_next_raytracing_reflection(EeveeRaytracingOptionsPanel):
def draw_header(self, context):
layout = self.layout
if context.scene.eevee.ray_split_settings == "UNIFIED":
if context.scene.eevee.ray_split_settings == 'UNIFIED':
layout.label(text="Reflection & Refraction")
else:
layout.label(text="Reflection")
@@ -683,7 +683,7 @@ class RENDER_PT_eevee_next_raytracing_refraction(EeveeRaytracingOptionsPanel):
@classmethod
def poll(cls, context):
return (context.scene.eevee.ray_split_settings == "SPLIT")
return (context.scene.eevee.ray_split_settings == 'SPLIT')
def draw(self, context):
self.draw_internal(context, context.scene.eevee.refraction_options)
@@ -858,8 +858,8 @@ class RENDER_PT_eevee_next_indirect_lighting(RenderButtonsPanel, Panel):
props = scene.eevee
col = layout.column()
col.operator("object.lightprobe_cache_bake", text="Bake Light Caches", icon='RENDER_STILL').subset = "ALL"
col.operator("object.lightprobe_cache_free", text="Delete Light Caches").subset = "ALL"
col.operator("object.lightprobe_cache_bake", text="Bake Light Caches", icon='RENDER_STILL').subset = 'ALL'
col.operator("object.lightprobe_cache_free", text="Delete Light Caches").subset = 'ALL'
col.prop(props, "gi_irradiance_pool_size", text="Pool Size")
+1 -1
View File
@@ -344,7 +344,7 @@ class OUTLINER_MT_asset(Menu):
def draw(self, _context):
layout = self.layout
layout.operator("asset.mark", icon="ASSET_MANAGER")
layout.operator("asset.mark", icon='ASSET_MANAGER')
layout.operator("asset.clear", text="Clear Asset").set_fake_user = False
layout.operator("asset.clear", text="Clear Asset (Set Fake User)").set_fake_user = True
@@ -1750,7 +1750,7 @@ class _defs_paint_grease_pencil:
if not brush:
return
layout.prop(brush.gpencil_settings, "eraser_mode", expand=True)
if brush.gpencil_settings.eraser_mode == "HARD":
if brush.gpencil_settings.eraser_mode == 'HARD':
layout.prop(brush.gpencil_settings, "use_keep_caps_eraser")
layout.prop(brush.gpencil_settings, "use_active_layer_only")
return dict(
+6 -6
View File
@@ -902,7 +902,7 @@ class VIEW3D_HT_header(Header):
icon = 'GROUP_VCOL' if canvas_source == 'COLOR_ATTRIBUTE' else canvas_source
row.popover(panel="VIEW3D_PT_slots_paint_canvas", icon=icon)
else:
row.popover(panel="VIEW3D_PT_slots_color_attributes", icon="GROUP_VCOL")
row.popover(panel="VIEW3D_PT_slots_color_attributes", icon='GROUP_VCOL')
layout.popover(
panel="VIEW3D_PT_sculpt_automasking",
@@ -913,12 +913,12 @@ class VIEW3D_HT_header(Header):
elif object_mode == 'VERTEX_PAINT':
row = layout.row()
row.ui_units_x = 6
row.popover(panel="VIEW3D_PT_slots_color_attributes", icon="GROUP_VCOL")
row.popover(panel="VIEW3D_PT_slots_color_attributes", icon='GROUP_VCOL')
elif object_mode == 'WEIGHT_PAINT':
row = layout.row()
row.ui_units_x = 6
row.popover(panel="VIEW3D_PT_slots_vertex_groups", icon="GROUP_VERTEX")
row.popover(panel="VIEW3D_PT_slots_vertex_groups", icon='GROUP_VERTEX')
elif object_mode == 'TEXTURE_PAINT':
tool_mode = tool_settings.image_paint.mode
@@ -927,7 +927,7 @@ class VIEW3D_HT_header(Header):
row = layout.row()
row.ui_units_x = 9
row.popover(panel="VIEW3D_PT_slots_projectpaint", icon=icon)
row.popover(panel="VIEW3D_PT_mask", icon="MOD_MASK", text="")
row.popover(panel="VIEW3D_PT_mask", icon='MOD_MASK', text="")
else:
# Transform settings depending on tool header visibility
VIEW3D_HT_header.draw_xform_template(layout, context)
@@ -2601,7 +2601,7 @@ class VIEW3D_MT_object(Menu):
layout.separator()
layout.menu("VIEW3D_MT_object_asset", icon="ASSET_MANAGER")
layout.menu("VIEW3D_MT_object_asset", icon='ASSET_MANAGER')
layout.menu("VIEW3D_MT_object_parent")
layout.menu("VIEW3D_MT_object_collection")
layout.menu("VIEW3D_MT_object_relations")
@@ -6569,7 +6569,7 @@ class VIEW3D_PT_shading_compositor(Panel):
row = self.layout.row()
row.active = is_supported
row.prop(shading, "use_compositor", expand=True)
if shading.use_compositor != "DISABLED" and not is_supported:
if shading.use_compositor != 'DISABLED' and not is_supported:
self.layout.label(text="Compositor not supported on this platform", icon='ERROR')