[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2863] trunk/py/scripts/addons: use sets for checking against multiple values.

Campbell Barton ideasman42 at gmail.com
Wed Jan 4 05:26:35 CET 2012


Revision: 2863
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2863
Author:   campbellbarton
Date:     2012-01-04 04:26:33 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
use sets for checking against multiple values.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_fbx/export_fbx.py
    trunk/py/scripts/addons/modules/cursor_utils.py
    trunk/py/scripts/addons/netrender/utils.py
    trunk/py/scripts/addons/render_renderfarmfi.py
    trunk/py/scripts/addons/rigify/ui.py
    trunk/py/scripts/addons/system_demo_mode/__init__.py

Modified: trunk/py/scripts/addons/io_scene_fbx/export_fbx.py
===================================================================
--- trunk/py/scripts/addons/io_scene_fbx/export_fbx.py	2012-01-04 04:22:16 UTC (rev 2862)
+++ trunk/py/scripts/addons/io_scene_fbx/export_fbx.py	2012-01-04 04:26:33 UTC (rev 2863)
@@ -1005,7 +1005,7 @@
             do_shadow = False
         else:
             do_light = not (light.use_only_shadow or (not light.use_diffuse and not light.use_specular))
-            do_shadow = (light.shadow_method in ('RAY_SHADOW', 'BUFFER_SHADOW'))
+            do_shadow = (light.shadow_method in {'RAY_SHADOW', 'BUFFER_SHADOW'})
 
         # scale = abs(global_matrix.to_scale()[0])  # scale is always uniform in this case  #  UNUSED
 

Modified: trunk/py/scripts/addons/modules/cursor_utils.py
===================================================================
--- trunk/py/scripts/addons/modules/cursor_utils.py	2012-01-04 04:22:16 UTC (rev 2862)
+++ trunk/py/scripts/addons/modules/cursor_utils.py	2012-01-04 04:26:33 UTC (rev 2863)
@@ -56,6 +56,3 @@
     def getCursor(cls):
         spc = cls.findSpace()
         return spc.cursor_location
-
-
-

Modified: trunk/py/scripts/addons/netrender/utils.py
===================================================================
--- trunk/py/scripts/addons/netrender/utils.py	2012-01-04 04:22:16 UTC (rev 2862)
+++ trunk/py/scripts/addons/netrender/utils.py	2012-01-04 04:26:33 UTC (rev 2863)
@@ -88,7 +88,7 @@
         def __exit__(self, exc_type, exc_value, traceback):
             pass
 
-if system in ('Windows', 'win32') and platform.version() >= '5': # Error mode is only available on Win2k or higher, that's version 5
+if system in {'Windows', 'win32'} and platform.version() >= '5': # Error mode is only available on Win2k or higher, that's version 5
     import ctypes
     class NoErrorDialogContext:
         def __init__(self):
@@ -189,9 +189,9 @@
 def clientConnection(address, port, report = None, scan = True, timeout = 5):
     if address == "[default]":
 #            calling operator from python is fucked, scene isn't in context
-#			if bpy:
-#				bpy.ops.render.netclientscan()
-#			else:
+#            if bpy:
+#                bpy.ops.render.netclientscan()
+#            else:
         if not scan:
             return None
 

Modified: trunk/py/scripts/addons/render_renderfarmfi.py
===================================================================
--- trunk/py/scripts/addons/render_renderfarmfi.py	2012-01-04 04:22:16 UTC (rev 2862)
+++ trunk/py/scripts/addons/render_renderfarmfi.py	2012-01-04 04:26:33 UTC (rev 2863)
@@ -774,7 +774,7 @@
             s = s + ' (' + stage + ')'
         #t = session['timestamps']
         sinfo = OreSession(session['sessionId'], s) 
-        if stage in ('Completed', 'Active'):
+        if stage in {'Completed', 'Active'}:
             sinfo.frames = session['framesRendered']
         sinfo.startframe = session['startFrame']
         sinfo.endframe = session['endFrame']

Modified: trunk/py/scripts/addons/rigify/ui.py
===================================================================
--- trunk/py/scripts/addons/rigify/ui.py	2012-01-04 04:22:16 UTC (rev 2862)
+++ trunk/py/scripts/addons/rigify/ui.py	2012-01-04 04:26:33 UTC (rev 2863)
@@ -38,7 +38,7 @@
             return False
         #obj = context.object
         #if obj:
-        #    return (obj.mode in ('POSE', 'OBJECT', 'EDIT'))
+        #    return (obj.mode in {'POSE', 'OBJECT', 'EDIT'})
         #return False
         return True
 
@@ -133,7 +133,7 @@
             return False
         obj = context.object
         if obj:
-            return (obj.mode in ('POSE'))
+            return obj.mode == 'POSE'
         return False
 
     def draw(self, context):

Modified: trunk/py/scripts/addons/system_demo_mode/__init__.py
===================================================================
--- trunk/py/scripts/addons/system_demo_mode/__init__.py	2012-01-04 04:22:16 UTC (rev 2862)
+++ trunk/py/scripts/addons/system_demo_mode/__init__.py	2012-01-04 04:26:33 UTC (rev 2863)
@@ -174,7 +174,7 @@
 
         layout.separator()
         sub = layout.column()
-        sub.active = (mode in ('AUTO', 'PLAY'))
+        sub.active = (mode in {'AUTO', 'PLAY'})
         sub.label("Animate Settings:")
         sub.prop(self, "anim_cycles")
         sub.prop(self, "anim_time_min")
@@ -183,7 +183,7 @@
 
         layout.separator()
         sub = layout.column()
-        sub.active = (mode in ('AUTO', 'RENDER'))
+        sub.active = (mode in {'AUTO', 'RENDER'})
         sub.label("Render Settings:")
         sub.prop(self, "display_render")
 



More information about the Bf-extensions-cvs mailing list