Commit be8f3552 authored by Fabien Morin's avatar Fabien Morin

minor changes:

we prefer to use "is None" and "is not None" instead of "== None" and "!= None"


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27304 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b96c38e
...@@ -222,7 +222,7 @@ class Amount(Base, Variated): ...@@ -222,7 +222,7 @@ class Amount(Base, Variated):
menus. menus.
""" """
resource = self.getResourceValue() resource = self.getResourceValue()
if resource != None: if resource is not None:
result = resource.getVariationCategoryItemList( result = resource.getVariationCategoryItemList(
omit_individual_variation=0,**kw) omit_individual_variation=0,**kw)
else: else:
......
...@@ -381,7 +381,7 @@ class Delivery(XMLObject, ImmobilisationDelivery): ...@@ -381,7 +381,7 @@ class Delivery(XMLObject, ImmobilisationDelivery):
deferred_simulation_movement_list = [] deferred_simulation_movement_list = []
# defer simulation movements # 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: for movement in movement_list:
start_date = start_date or movement.getStartDate() start_date = start_date or movement.getStartDate()
stop_date = stop_date or movement.getStopDate() stop_date = stop_date or movement.getStopDate()
......
...@@ -100,9 +100,9 @@ class MailMessage(Event, CMFMailInMessage): ...@@ -100,9 +100,9 @@ class MailMessage(Event, CMFMailInMessage):
Sends a reply to this mail message. Sends a reply to this mail message.
""" """
# We assume by default that we are replying to the sender # We assume by default that we are replying to the sender
if from_url == None: if from_url is None:
from_url = self.getUrlString() from_url = self.getUrlString()
if to_url == None: if to_url is None:
to_url = self.getSender() to_url = self.getSender()
if msg is not None and subject is not None: if msg is not None and subject is not None:
header = "From: %s\n" % from_url header = "From: %s\n" % from_url
......
...@@ -259,7 +259,7 @@ class Telephone(Coordinate, Base): ...@@ -259,7 +259,7 @@ class Telephone(Coordinate, Base):
number_match = possible_number_match number_match = possible_number_match
number_dict = number_match.groupdict() number_dict = number_match.groupdict()
break break
if number_match == None: if number_match is None:
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
msg = "Doesn't exist a regex to handle this telephone: ", \ msg = "Doesn't exist a regex to handle this telephone: ", \
coordinate_text coordinate_text
......
...@@ -145,7 +145,7 @@ class Transformation(XMLObject, Predicate, Variated): ...@@ -145,7 +145,7 @@ class Transformation(XMLObject, Predicate, Variated):
base_category_list = self.getVariationBaseCategoryList() base_category_list = self.getVariationBaseCategoryList()
resource = self.getResourceValue() resource = self.getResourceValue()
if resource != None: if resource is not None:
result = resource.getVariationCategoryItemList( result = resource.getVariationCategoryItemList(
base_category_list=base_category_list, base_category_list=base_category_list,
omit_individual_variation=omit_individual_variation, omit_individual_variation=omit_individual_variation,
......
...@@ -187,7 +187,7 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount): ...@@ -187,7 +187,7 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
error_string = '' error_string = ''
# Add resource relation # Add resource relation
resource = self.getDefaultResourceValue() resource = self.getDefaultResourceValue()
if resource != None: if resource is not None:
tmp_amount.setResourceValue(resource) tmp_amount.setResourceValue(resource)
else: else:
error_string += 'No resource defined on %s' % self.getRelativeUrl() error_string += 'No resource defined on %s' % self.getRelativeUrl()
...@@ -261,8 +261,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount): ...@@ -261,8 +261,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
quantity = None quantity = None
# We will browse the mapped values and determine which apply # We will browse the mapped values and determine which apply
cell_key_list = self.getCellKeyList(base_id='quantity') cell_key_list = self.getCellKeyList(base_id='quantity')
if cell_key_list not in [(),[]]: if cell_key_list not in [(),[]]:
if context == None: if context is None:
raise KeyError, \ raise KeyError, \
"No context defined on TransformedResource '%s'" % \ "No context defined on TransformedResource '%s'" % \
(self.getRelativeUrl(), ) (self.getRelativeUrl(), )
...@@ -296,8 +296,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount): ...@@ -296,8 +296,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
variation_category_list = None variation_category_list = None
# We will browse the mapped values and determine which apply # We will browse the mapped values and determine which apply
cell_key_list = self.getCellKeyList( base_id = 'variation') cell_key_list = self.getCellKeyList( base_id = 'variation')
if cell_key_list not in [(),[]]: if cell_key_list not in [(),[]]:
if context == None: if context is None:
raise KeyError, \ raise KeyError, \
"No context defined on TransformedResource '%s'" % \ "No context defined on TransformedResource '%s'" % \
(self.getRelativeUrl(), ) (self.getRelativeUrl(), )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment