[Erp5-report] r27304 - /erp5/trunk/products/ERP5/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jun 1 14:07:14 CEST 2009


Author: fabien
Date: Mon Jun  1 14:07:13 2009
New Revision: 27304

URL: http://svn.erp5.org?rev=27304&view=rev
Log:
minor changes:
we prefer to use "is None" and "is not None" instead of "== None" and "!= None"

Modified:
    erp5/trunk/products/ERP5/Document/Amount.py
    erp5/trunk/products/ERP5/Document/Delivery.py
    erp5/trunk/products/ERP5/Document/MailMessage.py
    erp5/trunk/products/ERP5/Document/Telephone.py
    erp5/trunk/products/ERP5/Document/Transformation.py
    erp5/trunk/products/ERP5/Document/TransformedResource.py

Modified: erp5/trunk/products/ERP5/Document/Amount.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Amount.py?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Amount.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Amount.py [utf8] Mon Jun  1 14:07:13 2009
@@ -222,7 +222,7 @@
       menus.
     """
     resource = self.getResourceValue()
-    if resource != None:
+    if resource is not None:
       result = resource.getVariationCategoryItemList(
                                omit_individual_variation=0,**kw)
     else:

Modified: erp5/trunk/products/ERP5/Document/Delivery.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Delivery.py?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Delivery.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Delivery.py [utf8] Mon Jun  1 14:07:13 2009
@@ -381,7 +381,7 @@
 
       deferred_simulation_movement_list = []
       # defer simulation movements
-      if start_date != None or stop_date != None:
+      if start_date is not None or stop_date is not None:
         for movement in movement_list:
           start_date = start_date or movement.getStartDate()
           stop_date = stop_date or movement.getStopDate()

Modified: erp5/trunk/products/ERP5/Document/MailMessage.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/MailMessage.py?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/MailMessage.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/MailMessage.py [utf8] Mon Jun  1 14:07:13 2009
@@ -100,9 +100,9 @@
       Sends a reply to this mail message.
     """
     # We assume by default that we are replying to the sender
-    if from_url == None:
+    if from_url is None:
       from_url = self.getUrlString()
-    if to_url == None:
+    if to_url is None:
       to_url = self.getSender()
     if msg is not None and subject is not None:
       header  = "From: %s\n"    % from_url

Modified: erp5/trunk/products/ERP5/Document/Telephone.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Telephone.py?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Telephone.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Telephone.py [utf8] Mon Jun  1 14:07:13 2009
@@ -259,7 +259,7 @@
           number_match = possible_number_match
           number_dict = number_match.groupdict()
           break
-      if number_match == None:
+      if number_match is None:
         from zLOG import LOG, WARNING
         msg = "Doesn't exist a regex to handle this telephone: ", \
                                                                coordinate_text

Modified: erp5/trunk/products/ERP5/Document/Transformation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Transformation.py?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Transformation.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Transformation.py [utf8] Mon Jun  1 14:07:13 2009
@@ -145,7 +145,7 @@
           base_category_list = self.getVariationBaseCategoryList()
 
         resource = self.getResourceValue()
-        if resource != None:
+        if resource is not None:
           result = resource.getVariationCategoryItemList(
                         base_category_list=base_category_list,
                         omit_individual_variation=omit_individual_variation,

Modified: erp5/trunk/products/ERP5/Document/TransformedResource.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TransformedResource.py?rev=27304&r1=27303&r2=27304&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TransformedResource.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TransformedResource.py [utf8] Mon Jun  1 14:07:13 2009
@@ -187,7 +187,7 @@
         error_string = ''
         # Add resource relation
         resource = self.getDefaultResourceValue()
-        if resource != None:
+        if resource is not None:
           tmp_amount.setResourceValue(resource)
         else:
           error_string += 'No resource defined on %s' % self.getRelativeUrl()
@@ -261,8 +261,8 @@
         quantity = None
         # We will browse the mapped values and determine which apply
         cell_key_list = self.getCellKeyList(base_id='quantity')
-        if cell_key_list not in [(),[]]: 
-          if context == None:
+        if cell_key_list not in [(),[]]:
+          if context is None:
             raise KeyError, \
                   "No context defined on TransformedResource '%s'" % \
                       (self.getRelativeUrl(), )
@@ -296,8 +296,8 @@
         variation_category_list = None
         # We will browse the mapped values and determine which apply
         cell_key_list = self.getCellKeyList( base_id = 'variation')
-        if cell_key_list not in [(),[]]: 
-          if context == None:
+        if cell_key_list not in [(),[]]:
+          if context is None:
             raise KeyError, \
                   "No context defined on TransformedResource '%s'" % \
                       (self.getRelativeUrl(), )




More information about the Erp5-report mailing list