Cleanup: don't use single sets for comparisons

This commit is contained in:
Campbell Barton 2015-04-14 10:29:11 +10:00
parent 2bceb3ae18
commit af2f4724d5
19 changed files with 28 additions and 28 deletions

View File

@ -894,7 +894,7 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel, Panel):
obj = context.object
if obj.type == 'ARMATURE' and obj.mode in {'POSE'}:
if obj.type == 'ARMATURE' and obj.mode == 'POSE':
box = layout.box()
box.alert = True # XXX: this should apply to the box background
box.label(icon='INFO', text="Constraints for active bone do not live here")

View File

@ -70,7 +70,7 @@ class MESH_UL_vgroups(UIList):
layout.prop(vgroup, "name", text="", emboss=False, icon_value=icon)
icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED'
layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)
@ -94,7 +94,7 @@ class MESH_UL_shape_keys(UIList):
else:
row.label(text="")
row.prop(key_block, "mute", text="", emboss=False)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)
@ -106,7 +106,7 @@ class MESH_UL_uvmaps_vcols(UIList):
layout.prop(item, "name", text="", emboss=False, icon_value=icon)
icon = 'RESTRICT_RENDER_OFF' if item.active_render else 'RESTRICT_RENDER_ON'
layout.prop(item, "active_render", text="", icon=icon, emboss=False)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)

View File

@ -95,7 +95,7 @@ class RENDERLAYER_UL_linesets(UIList):
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.prop(lineset, "name", text="", emboss=False, icon_value=icon)
layout.prop(lineset, "show_render", text="", index=index)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)

View File

@ -321,7 +321,7 @@ class GPENCIL_UL_layer(UIList):
row = layout.row(align=True)
row.prop(gpl, "lock", text="", emboss=False)
row.prop(gpl, "hide", text="", emboss=False)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)

View File

@ -36,7 +36,7 @@ class MASK_UL_layers(UIList):
row.prop(mask, "hide", text="", emboss=False)
row.prop(mask, "hide_select", text="", emboss=False)
row.prop(mask, "hide_render", text="", emboss=False)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)

View File

@ -87,7 +87,7 @@ class MATERIAL_UL_matslots(UIList):
layout.label(text=iface_("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
elif ma.use_nodes:
layout.label(text="Node <none>")
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)

View File

@ -118,7 +118,7 @@ class PARTICLE_UL_particle_systems(bpy.types.UIList):
layout.prop(md, "show_render", emboss=False, icon_only=True, icon='RESTRICT_RENDER_OFF' if md.show_render else 'RESTRICT_RENDER_ON')
layout.prop(md, "show_viewport", emboss=False, icon_only=True, icon='RESTRICT_VIEW_OFF' if md.show_viewport else 'RESTRICT_VIEW_ON')
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)
@ -1243,7 +1243,7 @@ class PARTICLE_PT_children(ParticleButtonsPanel, Panel):
split = layout.split()
split.active = part.kink != 'NO'
if part.kink in {'SPIRAL'}:
if part.kink == 'SPIRAL':
col = split.column()
sub = col.column(align=True)
sub.prop(part, "kink_amplitude", text="Radius")

View File

@ -40,7 +40,7 @@ class PHYSICS_UL_dynapaint_surfaces(UIList):
row.prop(surf, "show_preview", text="", emboss=False,
icon='RESTRICT_VIEW_OFF' if surf.show_preview else 'RESTRICT_VIEW_ON')
row.prop(surf, "is_active", text="")
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
row = layout.row(align=True)
row.label(text="", icon_value=icon)

View File

@ -40,7 +40,7 @@ class RENDERLAYER_UL_renderlayers(UIList):
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.prop(layer, "name", text="", icon_value=icon, emboss=False)
layout.prop(layer, "use", text="", index=index)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)

View File

@ -35,7 +35,7 @@ class SCENE_UL_keying_set_paths(UIList):
if self.layout_type in {'DEFAULT', 'COMPACT'}:
# Do not make this one editable in uiList for now...
layout.label(text=kspath.data_path, translate=False, icon_value=icon)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)

View File

@ -72,7 +72,7 @@ class TEXTURE_UL_texslots(UIList):
layout.label(text="", icon_value=icon)
if tex and isinstance(item, bpy.types.MaterialTextureSlot):
layout.prop(ma, "use_textures", text="", index=index)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="", icon_value=icon)

View File

@ -37,7 +37,7 @@ class CLIP_UL_tracking_objects(UIList):
layout.prop(tobj, "name", text="", emboss=False,
icon='CAMERA_DATA' if tobj.is_camera
else 'OBJECT_DATA')
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="",
icon='CAMERA_DATA' if tobj.is_camera
@ -147,7 +147,7 @@ class CLIP_HT_header(Header):
sc = context.space_data
if sc.mode in {'TRACKING'}:
if sc.mode == 'TRACKING':
self._draw_tracking(context)
else:
self._draw_masking(context)
@ -716,7 +716,7 @@ class CLIP_PT_tracking_camera(Panel):
if CLIP_PT_clip_view_panel.poll(context):
sc = context.space_data
return sc.mode in {'TRACKING'} and sc.clip
return sc.mode == 'TRACKING' and sc.clip
return False
@ -756,7 +756,7 @@ class CLIP_PT_tracking_lens(Panel):
if CLIP_PT_clip_view_panel.poll(context):
sc = context.space_data
return sc.mode in {'TRACKING'} and sc.clip
return sc.mode == 'TRACKING' and sc.clip
return False
@ -893,7 +893,7 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
if CLIP_PT_clip_view_panel.poll(context):
sc = context.space_data
return sc.mode in {'TRACKING'} and sc.clip
return sc.mode == 'TRACKING' and sc.clip
return False

View File

@ -104,7 +104,7 @@ class FILEBROWSER_UL_dir(bpy.types.UIList):
else:
row.prop(direntry, "name", text="", emboss=False, icon=icon)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.prop(direntry, "path", text="")

View File

@ -1057,7 +1057,7 @@ class ImageScopesPanel:
if not (sima and sima.image):
return False
# scopes are not updated in paint modes, hide
if sima.mode in {'PAINT'}:
if sima.mode == 'PAINT':
return False
ob = context.active_object
if ob and ob.mode in {'TEXTURE_PAINT', 'EDIT'}:

View File

@ -441,7 +441,7 @@ class NODE_UL_interface_sockets(bpy.types.UIList):
if socket.is_output:
row.template_node_socket(color)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.template_node_socket(color)

View File

@ -473,7 +473,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
split.label(text="Type:")
split.prop(strip, "type", text="")
if strip.type not in {'SOUND'}:
if strip.type != 'SOUND':
split = layout.split(percentage=0.3)
split.label(text="Blend:")
split.prop(strip, "blend_type", text="")

View File

@ -158,7 +158,7 @@ class VIEW3D_MT_editor_menus(Menu):
if edit_object:
layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower())
elif obj:
if mode_string not in {'PAINT_TEXTURE'}:
if mode_string != 'PAINT_TEXTURE':
layout.menu("VIEW3D_MT_%s" % mode_string.lower())
if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
layout.menu("VIEW3D_MT_brush")

View File

@ -100,7 +100,7 @@ class VIEW3D_PT_tools_object(View3DPanel, Panel):
row.operator("object.shade_smooth", text="Smooth")
row.operator("object.shade_flat", text="Flat")
if obj_type in {'MESH'}:
if obj_type == 'MESH':
col = layout.column(align=True)
col.label(text="Data Transfer:")
row = col.row(align=True)
@ -1075,7 +1075,7 @@ class TEXTURE_UL_texpaintslots(UIList):
if (not mat.use_nodes) and context.scene.render.engine in {'BLENDER_RENDER', 'BLENDER_GAME'}:
mtex_index = mat.texture_paint_slots[index].index
layout.prop(mat, "use_textures", text="", index=mtex_index)
elif self.layout_type in {'GRID'}:
elif self.layout_type == 'GRID':
layout.alignment = 'CENTER'
layout.label(text="")
@ -1858,7 +1858,7 @@ class VIEW3D_PT_tools_history(View3DPanel, Panel):
row = col.row(align=True)
row.operator("ed.undo")
row.operator("ed.redo")
if obj is None or obj.mode not in {'SCULPT'}:
if obj is None or obj.mode != 'SCULPT':
# Sculpt mode does not generate an undo menu it seems...
col.operator("ed.undo_history")

View File

@ -62,7 +62,7 @@ def is_directive_pydata(filepath, directive):
return True
elif directive.type in {"module", "note", "warning", "code-block", "hlist", "seealso"}:
return False
elif directive.type in {"literalinclude"}: # TODO
elif directive.type == "literalinclude": # TODO
return False
else:
print(directive_to_str(filepath, directive), end=" ")