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):
menus.
"""
resource = self.getResourceValue()
if resource != None:
if resource is not None:
result = resource.getVariationCategoryItemList(
omit_individual_variation=0,**kw)
else:
......
......@@ -381,7 +381,7 @@ class Delivery(XMLObject, ImmobilisationDelivery):
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()
......
......@@ -100,9 +100,9 @@ class MailMessage(Event, CMFMailInMessage):
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
......
......@@ -259,7 +259,7 @@ class Telephone(Coordinate, Base):
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
......
......@@ -145,7 +145,7 @@ class Transformation(XMLObject, Predicate, Variated):
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,
......
......@@ -187,7 +187,7 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
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 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
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 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
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(), )
......
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