Cleanup: python quotes

This commit is contained in:
Campbell Barton 2018-12-18 15:01:03 +11:00
parent 7721886ead
commit afc4cd1e67
Notes: blender-bot 2023-02-14 05:02:32 +01:00
Referenced by issue #59536, Wrong Camera Safe Areas: The default values of Title Safe Margins and Action Safe Margins replace each other
Referenced by issue #57773, New 2.79 builds from Master freezes when opening a 2.79b file and then Creating a New File
6 changed files with 24 additions and 24 deletions

View File

@ -200,9 +200,9 @@ class AddTorus(Operator, object_utils.AddObjectHelper):
layout = self.layout
col = layout.column(align=True)
col.prop(self, 'generate_uvs')
col.prop(self, "generate_uvs")
col.separator()
col.prop(self, 'view_align')
col.prop(self, "view_align")
col = layout.column(align=True)
col.label(text="Location")

View File

@ -264,12 +264,12 @@ class WM_OT_blend_strings_utf8_validate(Operator):
return False
done_items.add(item)
if getattr(item, 'library', None) is not None:
if getattr(item, "library", None) is not None:
return False # No point in checking library data, we cannot fix it anyway...
changed = False
for prop in item.bl_rna.properties:
if prop.identifier in {'bl_rna', 'rna_type'}:
if prop.identifier in {"bl_rna", "rna_type"}:
continue # Or we'd recurse 'till Hell freezes.
if prop.is_readonly:
continue

View File

@ -749,7 +749,7 @@ class ConstraintButtonsPanel:
layout.prop(con, "shrinkwrap_type")
if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE', 'TARGET_PROJECT'}:
layout.prop(con, 'wrap_mode', text="Snap Mode")
layout.prop(con, "wrap_mode", text="Snap Mode")
if con.shrinkwrap_type == 'PROJECT':
row = layout.row(align=True)

View File

@ -177,7 +177,7 @@ class TEXTURE_PT_node_mapping(TextureButtonsPanel, Panel):
def poll(cls, context):
node = context.texture_node
# TODO(sergey): perform a faster/nicer check?
return node and hasattr(node, 'texture_mapping') and (context.engine in cls.COMPAT_ENGINES)
return node and hasattr(node, "texture_mapping") and (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout

View File

@ -45,9 +45,9 @@ class USERPREF_HT_header(Header):
layout.operator("wm.addon_refresh", icon='FILE_REFRESH')
layout.menu("USERPREF_MT_addons_online_resources")
elif userpref.active_section == 'LIGHTS':
layout.operator('wm.studiolight_install', text="Add MatCap").type = 'MATCAP'
layout.operator('wm.studiolight_install', text="Add LookDev HDRI").type = 'WORLD'
op = layout.operator('wm.studiolight_install', text="Add Studio Light")
layout.operator("wm.studiolight_install", text="Add MatCap").type = 'MATCAP'
layout.operator("wm.studiolight_install", text="Add LookDev HDRI").type = 'WORLD'
op = layout.operator("wm.studiolight_install", text="Add Studio Light")
op.type = 'STUDIO'
op.filter_glob = ".sl"
elif userpref.active_section == 'THEMES':
@ -1521,11 +1521,11 @@ class StudioLightPanelMixin():
row.template_icon(layout.icon(studio_light), scale=6.0)
col = row.column()
op = col.operator('wm.studiolight_uninstall', text="", icon='REMOVE')
op = col.operator("wm.studiolight_uninstall", text="", icon='REMOVE')
op.index = studio_light.index
if studio_light.type == 'STUDIO':
op = col.operator('wm.studiolight_copy_settings', text="", icon='IMPORT')
op = col.operator("wm.studiolight_copy_settings", text="", icon='IMPORT')
op.index = studio_light.index
box.label(text=studio_light.name)
@ -1571,7 +1571,7 @@ class USERPREF_PT_studiolight_light_editor(Panel):
row = layout.row()
row.prop(system, "edit_studio_light", toggle=True)
row.operator('wm.studiolight_new', text="Save as Studio light", icon="FILE_TICK")
row.operator("wm.studiolight_new", text="Save as Studio light", icon="FILE_TICK")
layout.separator()

View File

@ -161,7 +161,7 @@ class VIEW3D_HT_header(Header):
show_snap = True
if show_snap:
snap_items = bpy.types.ToolSettings.bl_rna.properties['snap_elements'].enum_items
snap_items = bpy.types.ToolSettings.bl_rna.properties["snap_elements"].enum_items
snap_elements = tool_settings.snap_elements
if len(snap_elements) == 1:
text = ""
@ -229,7 +229,7 @@ class VIEW3D_HT_header(Header):
# grease pencil
if object_mode == 'PAINT_GPENCIL':
origin = tool_settings.gpencil_stroke_placement_view3d
gp_origin = tool_settings.bl_rna.properties['gpencil_stroke_placement_view3d'].enum_items[origin]
gp_origin = tool_settings.bl_rna.properties["gpencil_stroke_placement_view3d"].enum_items[origin]
or_icon = getattr(gp_origin, "icon", "BLANK1")
or_name = getattr(gp_origin, "name", "Stroke Placement")
@ -4024,7 +4024,7 @@ class VIEW3D_MT_object_mode_pie(Menu):
layout = self.layout
pie = layout.menu_pie()
pie.operator_enum("OBJECT_OT_mode_set", "mode")
pie.operator_enum("object.mode_set", "mode")
class VIEW3D_MT_view_pie(Menu):
@ -4035,7 +4035,7 @@ class VIEW3D_MT_view_pie(Menu):
layout = self.layout
pie = layout.menu_pie()
pie.operator_enum("VIEW3D_OT_view_axis", "type")
pie.operator_enum("view3d.view_axis", "type")
pie.operator("view3d.view_camera", text="View Camera", icon='CAMERA_DATA')
pie.operator("view3d.view_selected", text="View Selected", icon='ZOOM_SELECTED')
@ -4067,7 +4067,7 @@ class VIEW3D_MT_shading_ex_pie(Menu):
pie.prop_enum(view.shading, "type", value='WIREFRAME')
pie.prop_enum(view.shading, "type", value='SOLID')
# Note this duplicates 'view3d.toggle_xray' logic, so we can see the active item: T58661.
# Note this duplicates "view3d.toggle_xray" logic, so we can see the active item: T58661.
if (
(context.mode == 'POSE') or
((context.mode == 'WEIGHT_PAINT') and (context.active_object.find_armature()))
@ -4422,7 +4422,7 @@ class VIEW3D_PT_shading_lighting(Panel):
sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon="NONE", toggle=True)
col = split.column()
col.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES')
col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES')
split = layout.split(factor=0.9)
col = split.column()
@ -4440,8 +4440,8 @@ class VIEW3D_PT_shading_lighting(Panel):
sub.template_icon_view(shading, "studio_light", scale=3)
col = split.column()
col.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES')
col.operator('VIEW3D_OT_toggle_matcap_flip', emboss=False, text="", icon='ARROW_LEFTRIGHT')
col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES')
col.operator("view3d.toggle_matcap_flip", emboss=False, text="", icon='ARROW_LEFTRIGHT')
elif shading.type == 'MATERIAL':
col.prop(shading, "use_scene_lights")
@ -4457,7 +4457,7 @@ class VIEW3D_PT_shading_lighting(Panel):
sub.template_icon_view(shading, "studio_light", scale=3)
col = split.column()
col.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES')
col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES')
if shading.selected_studio_light.type == 'WORLD':
split = layout.split(factor=0.9)
@ -4482,16 +4482,16 @@ class VIEW3D_PT_shading_color(Panel):
layout = self.layout
shading = VIEW3D_PT_shading.get_shading(context)
layout.row().prop(shading, 'color_type', expand=True)
layout.row().prop(shading, "color_type", expand=True)
if shading.color_type == 'SINGLE':
layout.row().prop(shading, 'single_color', text="")
layout.row().prop(shading, "single_color", text="")
def _draw_background_color(self, context):
layout = self.layout
shading = VIEW3D_PT_shading.get_shading(context)
layout.row().label(text="Background")
layout.row().prop(shading, 'background_type', expand=True)
layout.row().prop(shading, "background_type", expand=True)
if shading.background_type == 'VIEWPORT':
layout.row().prop(shading, "background_color", text="")