Cleanup: don't use single sets for comparisons
authorCampbell Barton <ideasman42@gmail.com>
Tue, 14 Apr 2015 00:29:11 +0000 (10:29 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 14 Apr 2015 00:34:32 +0000 (10:34 +1000)
19 files changed:
release/scripts/startup/bl_ui/properties_constraint.py
release/scripts/startup/bl_ui/properties_data_mesh.py
release/scripts/startup/bl_ui/properties_freestyle.py
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
release/scripts/startup/bl_ui/properties_mask_common.py
release/scripts/startup/bl_ui/properties_material.py
release/scripts/startup/bl_ui/properties_particle.py
release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py
release/scripts/startup/bl_ui/properties_render_layer.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_clip.py
release/scripts/startup/bl_ui/space_filebrowser.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_node.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
tests/python/bl_rst_completeness.py

index 9aa67223fc4c6dc802dbedf746b345b2066f4a01..483da82e6a34bb693fdfac01be0c0c28969667bb 100644 (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")
index 058f6283619d6eb5bb4bb5f7b241ee5f0257eb7e..e2b0121cdbe5d362c2bda04b37e981d9a443b6b8 100644 (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)
 
index 2d91c99800715395844a0625d67474f8903a18f3..adc706569b1ac889c72886b3859b08676cb41fce 100644 (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)
 
index 5b5a7648d837cbc9a9a54f49b55118dfccf1c03f..50886231347b34f8a4d8a7eba722d84c1edace19 100644 (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)
 
index cb4a0f5bb85d24cc41e0aa370330b289b59427d7..9d94d5efa2e04940a3b8f2bdf62ce852ce6171f1 100644 (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)
 
index 20143b81d14323e0646c3c4375678c073faa1b62..cea0c9aef9538191e0855172a7ade678e7bc5b57 100644 (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)
 
index 29be9ac21587c3e96b7e84820f0d61ab33a18b0d..e294f5487a6da84f7dd6dc360e3570667537462c 100644 (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")
index 01dcf837546f18a1ac384e497771f4a07e4011b1..269ffa6d371e878dc580e784ab7de4cfad64d768 100644 (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)
index 18c75ccb20c4bdfb60399aef2efd6fd343cd71d6..b23892df4089101ec1a46e60d2d342ed77f1b13f 100644 (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)
 
index facf54d358a0778e272a3f6690a217a89b11a8d8..b4c4ed6ceae0b3c5d49ab71e7423bce1ba07fac2 100644 (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)
 
index a48e06249fbeaa5a3a023933b3acbab61e214279..98a52444a5a5b6be8de1b1ba2b2361f4e3fbb403 100644 (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)
 
index a7a352f303b10d9c08ac0baa876ade40d8f4c91a..24b17b704935b2c95d198c61a5b2f0d2195a9f5e 100644 (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
 
index cf7669e74a4cac30830985ffcd1df9cb2298b127..44dfe2a688eca6dc1f4b19d0d401fe98b2944b9a 100644 (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="")
 
index 9a1b9dbc74f48be7aa94598edb50da441ddb9caf..e454216308628107d243455ab8151d05e70bf1ad 100644 (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'}:
index 31bfed21c4a7d4850ae39fb9acd31a08164e7812..18890aadc937fb541e63d857a38def74774a3fc4 100644 (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)
 
index e19cf8239d7067c835cbbc7c881734fb6f229ee6..4bb65ff7869024c8391246ad644fb7ac9a5331e4 100644 (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="")
index 32b8af140f476750a382eed12b714fe8e6d5aa3c..4d8230e2f4d61c2604acaa7577bcda61ad9a81d8 100644 (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")
index f01ea793e4ff9459aebd379a27c447a186ab9821..d5f64a7dd0acaec5c875d19f7bab08ad77f17686 100644 (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")
 
index d0ba2c552cfde8b893b6debac268cf53db26ac7d..d8dfac66d135740b6c2c43e20e425c163c30124e 100644 (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=" ")