[CMF-checkins] CVS: Products/CMFDefault - DiscussionItem.py:1.43.2.2 MetadataTool.py:1.26.2.1

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


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

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


=== Products/CMFDefault/DiscussionItem.py 1.43.2.1 => 1.43.2.2 ===
--- Products/CMFDefault/DiscussionItem.py:1.43.2.1	Fri Sep  3 13:04:36 2004
+++ Products/CMFDefault/DiscussionItem.py	Thu Apr  7 12:37:46 2005
@@ -15,11 +15,13 @@
 $Id$
 """
 
-from Globals import Persistent, PersistentMapping, InitializeClass
 from AccessControl import ClassSecurityInfo
 from Acquisition import Implicit, aq_base, aq_inner, aq_parent
-from OFS.Traversable import Traversable
 from DateTime import DateTime
+from Globals import InitializeClass
+from Globals import Persistent
+from Globals import PersistentMapping
+from OFS.Traversable import Traversable
 
 from Products.CMFCore.interfaces.Discussions import Discussable
 from Products.CMFCore.interfaces.Discussions import DiscussionResponse
@@ -30,6 +32,7 @@
 from permissions import ManagePortal
 from permissions import ReplyToItem
 from permissions import View
+from utils import scrubHTML
 
 
 factory_type_information = (
@@ -57,8 +60,6 @@
 )
 
 
-from utils import scrubHTML
-
 def addDiscussionItem(self, id, title, description, text_format, text,
                       reply_to, RESPONSE=None):
     """
@@ -334,9 +335,9 @@
         """
         outer = self._getDiscussable( outer=1 )
         if content_obj == outer:
-            return not not len( self._container )
+            return bool( len(self._container) )
         else:
-            return not not len( content_obj.talkback._getReplyResults() )
+            return bool( len( content_obj.talkback._getReplyResults() ) )
 
     security.declareProtected(View, 'replyCount')
     def replyCount( self, content_obj ):
@@ -433,6 +434,5 @@
         result.sort( lambda a, b: cmp(a[1].creation_date, b[1].creation_date) )
 
         return [ x[0] for x in result ]
-
 
 InitializeClass( DiscussionItemContainer )


=== Products/CMFDefault/MetadataTool.py 1.26 => 1.26.2.1 ===
--- Products/CMFDefault/MetadataTool.py:1.26	Thu Aug 12 11:07:40 2004
+++ Products/CMFDefault/MetadataTool.py	Thu Apr  7 12:37:46 2005
@@ -49,8 +49,8 @@
     enforce_vocabulary  = 0
     allowed_vocabulary  = ()
 
-    def __init__( self, is_multi_valued=0 ):
-        self.is_multi_valued    = not not is_multi_valued
+    def __init__(self, is_multi_valued=False):
+        self.is_multi_valued = bool(is_multi_valued)
 
     #
     #   Mutator.
@@ -63,11 +63,11 @@
             , enforce_vocabulary
             , allowed_vocabulary
             ):
-        self.is_required        = not not is_required
-        self.supply_default     = not not supply_default
+        self.is_required        = bool(is_required)
+        self.supply_default     = bool(supply_default)
         self.default_value      = default_value
-        self.enforce_vocabulary = not not enforce_vocabulary
-        self.allowed_vocabulary = tuple( allowed_vocabulary )
+        self.enforce_vocabulary = bool(enforce_vocabulary)
+        self.allowed_vocabulary = tuple(allowed_vocabulary)
 
     #
     #   Query interface



More information about the CMF-checkins mailing list