[CMF-checkins] CVS: Products/DCWorkflow - States.py:1.16.2.1 Variables.py:1.10.2.1 Worklists.py:1.12.2.1

Yvo Schubbe y.2005- at wcm-solutions.de
Thu Apr 7 12:37:48 EDT 2005


Update of /cvs-repository/Products/DCWorkflow
In directory cvs.zope.org:/tmp/cvs-serv14996/DCWorkflow

Modified Files:
      Tag: CMF-1_5-branch
	States.py Variables.py Worklists.py 
Log Message:
- get rid of 'not not' and types module
- import and whitespace cleanup


=== Products/DCWorkflow/States.py 1.16 => 1.16.2.1 ===
--- Products/DCWorkflow/States.py:1.16	Thu Aug 12 11:07:44 2004
+++ Products/DCWorkflow/States.py	Thu Apr  7 12:37:47 2005
@@ -15,16 +15,13 @@
 $Id$
 """
 
-from types import TupleType
-
+from AccessControl import ClassSecurityInfo
 from Acquisition import aq_inner
 from Acquisition import aq_parent
 from Globals import DTMLFile
-from Globals import PersistentMapping
 from Globals import InitializeClass
+from Globals import PersistentMapping
 from OFS.SimpleItem import SimpleItem
-from AccessControl import ClassSecurityInfo
-
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 
 from ContainerTab import ContainerTab
@@ -32,7 +29,7 @@
 from utils import _dtmldir
 
 
-class StateDefinition (SimpleItem):
+class StateDefinition(SimpleItem):
     """State definition"""
 
     meta_type = 'Workflow State'
@@ -94,7 +91,7 @@
         if roles is None:
             return {'acquired':1, 'roles':[]}
         else:
-            if type(roles) is TupleType:
+            if isinstance(roles, tuple):
                 acq = 0
             else:
                 acq = 1
@@ -254,7 +251,7 @@
 InitializeClass(StateDefinition)
 
 
-class States (ContainerTab):
+class States(ContainerTab):
     """A container for state definitions"""
 
     meta_type = 'Workflow States'


=== Products/DCWorkflow/Variables.py 1.10 => 1.10.2.1 ===
--- Products/DCWorkflow/Variables.py:1.10	Thu Aug 12 11:07:44 2004
+++ Products/DCWorkflow/Variables.py	Thu Apr  7 12:37:47 2005
@@ -15,20 +15,21 @@
 $Id$
 """
 
-from OFS.SimpleItem import SimpleItem
-from Globals import DTMLFile
-from Globals import InitializeClass
+from AccessControl import ClassSecurityInfo
 from Acquisition import aq_inner
 from Acquisition import aq_parent
-from AccessControl import ClassSecurityInfo
+from Globals import DTMLFile
+from Globals import InitializeClass
+from OFS.SimpleItem import SimpleItem
 
 from ContainerTab import ContainerTab
-from Guard import Guard
 from Expression import Expression
+from Guard import Guard
 from permissions import ManagePortal
 from utils import _dtmldir
 
-class VariableDefinition (SimpleItem):
+
+class VariableDefinition(SimpleItem):
     """Variable definition"""
 
     meta_type = 'Workflow Variable'
@@ -98,16 +99,16 @@
             self.info_guard = g
         else:
             self.info_guard = None
-        self.for_catalog = not not for_catalog  # Pure boolean value
-        self.for_status = not not for_status
-        self.update_always = not not update_always
+        self.for_catalog = bool(for_catalog)
+        self.for_status = bool(for_status)
+        self.update_always = bool(update_always)
         if REQUEST is not None:
             return self.manage_properties(REQUEST, 'Properties changed.')
 
 InitializeClass(VariableDefinition)
 
 
-class Variables (ContainerTab):
+class Variables(ContainerTab):
     """A container for variable definitions"""
 
     meta_type = 'Workflow Variables'


=== Products/DCWorkflow/Worklists.py 1.12 => 1.12.2.1 ===
--- Products/DCWorkflow/Worklists.py:1.12	Thu Aug 12 11:07:44 2004
+++ Products/DCWorkflow/Worklists.py	Thu Apr  7 12:37:47 2005
@@ -15,15 +15,13 @@
 $Id$
 """
 
-from types import TupleType
-
-from OFS.SimpleItem import SimpleItem
+from AccessControl import ClassSecurityInfo
+from Acquisition import aq_inner
+from Acquisition import aq_parent
 from Globals import DTMLFile
 from Globals import InitializeClass
 from Globals import PersistentMapping
-from Acquisition import aq_inner
-from Acquisition import aq_parent
-from AccessControl import ClassSecurityInfo
+from OFS.SimpleItem import SimpleItem
 
 from ContainerTab import ContainerTab
 from Guard import Guard
@@ -31,7 +29,7 @@
 from utils import _dtmldir
 
 
-class WorklistDefinition (SimpleItem):
+class WorklistDefinition(SimpleItem):
     """Worklist definiton"""
 
     meta_type = 'Worklist'
@@ -86,7 +84,7 @@
     def getVarMatch(self, id):
         if self.var_matches:
             matches = self.var_matches.get(id, ())
-            if not isinstance(matches, TupleType):
+            if not isinstance(matches, tuple):
                 # Old version, convert it.
                 matches = (matches,)
                 self.var_matches[id] = matches
@@ -142,7 +140,7 @@
 InitializeClass(WorklistDefinition)
 
 
-class Worklists (ContainerTab):
+class Worklists(ContainerTab):
     """A container for worklist definitions"""
 
     meta_type = 'Worklists'



More information about the CMF-checkins mailing list