[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39604] trunk/blender/release/scripts: pep8 edits and change '!= None' to 'is not None'

Campbell Barton ideasman42 at gmail.com
Mon Aug 22 11:01:50 CEST 2011


Revision: 39604
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39604
Author:   campbellbarton
Date:     2011-08-22 09:01:49 +0000 (Mon, 22 Aug 2011)
Log Message:
-----------
pep8 edits and change '!= None' to 'is not None'

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py
    trunk/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py
    trunk/blender/release/scripts/startup/bl_ui/properties_data_camera.py
    trunk/blender/release/scripts/startup/bl_ui/properties_particle.py
    trunk/blender/release/scripts/startup/bl_ui/space_console.py
    trunk/blender/release/scripts/startup/bl_ui/space_dopesheet.py
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_info.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    trunk/blender/release/scripts/templates/operator_export.py
    trunk/blender/release/scripts/templates/operator_simple.py

Modified: trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/modules/bpy_extras/mesh_utils.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -426,7 +426,7 @@
         # See if its flipped the wrong way.
         flip = None
         for fi in fill:
-            if flip != None:
+            if flip is not None:
                 break
             for i, vi in enumerate(fi):
                 if vi == 0 and fi[i - 1] == 1:

Modified: trunk/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_operators/uvcalc_smart_project.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -178,7 +178,7 @@
     intersectCount = 0
     for ed in edges:
         xi, yi = lineIntersection2D(x1,y1, x2,y2, ed[0][0], ed[0][1], ed[1][0], ed[1][1])
-        if xi != None: # Is there an intersection.
+        if xi is not None: # Is there an intersection.
             intersectCount+=1
 
     return intersectCount % 2
@@ -1131,7 +1131,7 @@
 
     @classmethod
     def poll(cls, context):
-        return context.active_object != None
+        return context.active_object is not None
 
     def execute(self, context):
         main(context,

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_data_camera.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_data_camera.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_data_camera.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -107,7 +107,7 @@
 
         col = split.column()
 
-        if cam.dof_object != None:
+        if cam.dof_object is not None:
             col.enabled = False
         col.prop(cam, "dof_distance", text="Distance")
 

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_particle.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_particle.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -156,7 +156,7 @@
         if part:
             split = layout.split(percentage=0.65)
             if part.type == 'HAIR':
-                if psys != None and psys.is_edited:
+                if psys is not None and psys.is_edited:
                     split.operator("particle.edited_clear", text="Free Edit")
                 else:
                     row = split.row()
@@ -166,12 +166,12 @@
                 row = split.row()
                 row.enabled = particle_panel_enabled(context, psys)
                 row.prop(part, "hair_step")
-                if psys != None and psys.is_edited:
+                if psys is not None and psys.is_edited:
                     if psys.is_global_hair:
                         layout.operator("particle.connect_hair")
                     else:
                         layout.operator("particle.disconnect_hair")
-            elif psys != None and part.type == 'REACTOR':
+            elif psys is not None and part.type == 'REACTOR':
                 split.enabled = particle_panel_enabled(context, psys)
                 split.prop(psys, "reactor_target_object")
                 split.prop(psys, "reactor_target_particle_system", text="Particle System")
@@ -654,7 +654,7 @@
 
         if settings is None:
             return False
-        if psys != None and psys.point_cache.use_external:
+        if psys is not None and psys.point_cache.use_external:
             return False
         return settings.physics_type == 'BOIDS' and engine in cls.COMPAT_ENGINES
 

Modified: trunk/blender/release/scripts/startup/bl_ui/space_console.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_console.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_ui/space_console.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -41,7 +41,7 @@
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator("console.clear")
         layout.operator("console.copy")
         layout.operator("console.paste")

Modified: trunk/blender/release/scripts/startup/bl_ui/space_dopesheet.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_dopesheet.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_ui/space_dopesheet.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -101,7 +101,7 @@
             row.menu("DOPESHEET_MT_select")
             row.menu("DOPESHEET_MT_marker")
 
-            if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action != None):
+            if st.mode == 'DOPESHEET' or (st.mode == 'ACTION' and st.action is not None):
                 row.menu("DOPESHEET_MT_channel")
             elif st.mode == 'GPENCIL':
                 row.menu("DOPESHEET_MT_gpencil_channel")

Modified: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -452,7 +452,7 @@
         split = layout.split()
 
         col = split.column()
-        
+
         col.prop(ima, "use_animation")
         sub = col.column(align=True)
         sub.active = ima.use_animation
@@ -507,7 +507,7 @@
         layout = self.layout
 
         sima = context.space_data
-        
+
         layout.template_waveform(sima, "scopes")
         row = layout.split(percentage=0.75)
         row.prop(sima.scopes, "waveform_alpha")
@@ -544,9 +544,9 @@
 
     def draw(self, context):
         layout = self.layout
-        
+
         sima = context.space_data
-        
+
         layout.operator("image.sample_line")
         layout.template_histogram(sima, "sample_histogram")
         layout.prop(sima.sample_histogram, "mode")
@@ -564,9 +564,9 @@
 
     def draw(self, context):
         layout = self.layout
-        
+
         sima = context.space_data
-        
+
         row = layout.row()
         row.prop(sima.scopes, "use_full_resolution")
         sub = row.row()
@@ -613,14 +613,14 @@
             col = layout.column()
             col.label("Cursor Location:")
             col.row().prop(uvedit, "cursor_location", text="")
-            
+
             col.separator()
-            
+
             col.label(text="UVs:")
             col.row().prop(uvedit, "edge_draw_type", expand=True)
 
             split = layout.split()
-            
+
             col = split.column()
             col.prop(uvedit, "show_faces")
             col.prop(uvedit, "show_smooth_edges", text="Smooth")

Modified: trunk/blender/release/scripts/startup/bl_ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_info.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_ui/space_info.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -194,7 +194,7 @@
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane")
         layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube")
@@ -215,7 +215,7 @@
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
         layout.operator("curve.primitive_bezier_circle_add", icon='CURVE_BEZCIRCLE', text="Circle")
@@ -246,7 +246,7 @@
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
         layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
@@ -262,7 +262,7 @@
 
     def draw(self, context):
         layout = self.layout
-        
+
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
 

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -1049,7 +1049,7 @@
         ob = context.active_object
 
         col = layout.column()
-        col.active = ob.vertex_groups.active != None
+        col.active = ob.vertex_groups.active is not None
         col.operator("object.vertex_group_normalize_all", text="Normalize All")
         col.operator("object.vertex_group_normalize", text="Normalize")
         col.operator("object.vertex_group_invert", text="Invert")

Modified: trunk/blender/release/scripts/templates/operator_export.py
===================================================================
--- trunk/blender/release/scripts/templates/operator_export.py	2011-08-22 08:47:48 UTC (rev 39603)
+++ trunk/blender/release/scripts/templates/operator_export.py	2011-08-22 09:01:49 UTC (rev 39604)
@@ -47,7 +47,7 @@
 
     @classmethod
     def poll(cls, context):
-        return context.active_object != None
+        return context.active_object is not None
 
     def execute(self, context):
         return write_some_data(context, self.filepath, self.use_setting)

Modified: trunk/blender/release/scripts/templates/operator_simple.py
===================================================================

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list