[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25351] trunk/blender/release/scripts/op/ wm.py: use Ellipsis rather then a class defined for an unset value.
Campbell Barton
ideasman42 at gmail.com
Mon Dec 14 02:58:08 CET 2009
Revision: 25351
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25351
Author: campbellbarton
Date: 2009-12-14 02:58:08 +0100 (Mon, 14 Dec 2009)
Log Message:
-----------
use Ellipsis rather then a class defined for an unset value. (since None is valid)
Modified Paths:
--------------
trunk/blender/release/scripts/op/wm.py
Modified: trunk/blender/release/scripts/op/wm.py
===================================================================
--- trunk/blender/release/scripts/op/wm.py 2009-12-14 00:06:24 UTC (rev 25350)
+++ trunk/blender/release/scripts/op/wm.py 2009-12-14 01:58:08 UTC (rev 25351)
@@ -43,10 +43,6 @@
description="Cycle backwards", default=False)
-class NullPath:
- pass
-
-
def context_path_validate(context, path):
import sys
try:
@@ -54,7 +50,7 @@
except AttributeError:
if "'NoneType'" in str(sys.exc_info()[1]):
# One of the items in the rna path is None, just ignore this
- value = NullPath
+ value = Ellipsis
else:
# We have a real error in the rna path, dont ignore that
raise
@@ -63,7 +59,7 @@
def execute_context_assign(self, context):
- if context_path_validate(context, self.properties.path) == NullPath:
+ if context_path_validate(context, self.properties.path) is Ellipsis:
return ('PASS_THROUGH',)
exec("context.%s=self.properties.value" % self.properties.path)
return ('FINISHED',)
@@ -137,7 +133,7 @@
def execute(self, context):
- if context_path_validate(context, self.properties.path) == NullPath:
+ if context_path_validate(context, self.properties.path) is Ellipsis:
return ('PASS_THROUGH',)
exec("context.%s=not (context.%s)" %
@@ -160,7 +156,7 @@
def execute(self, context):
- if context_path_validate(context, self.properties.path) == NullPath:
+ if context_path_validate(context, self.properties.path) is Ellipsis:
return ('PASS_THROUGH',)
exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \
@@ -182,7 +178,7 @@
def execute(self, context):
value = context_path_validate(context, self.properties.path)
- if value == NullPath:
+ if value is Ellipsis:
return ('PASS_THROUGH',)
self.properties.value = value
@@ -214,7 +210,7 @@
def execute(self, context):
value = context_path_validate(context, self.properties.path)
- if value == NullPath:
+ if value is Ellipsis:
return ('PASS_THROUGH',)
orig_value = value
More information about the Bf-blender-cvs
mailing list