Commit eb3cfecd authored by Nicolas Delaby's avatar Nicolas Delaby

Use boolean instead of integer

parent 4aa4c4f6
......@@ -108,9 +108,7 @@ class ERP5Diff:
"""
Check whether the element has any children
"""
if len(element) == 0:
return False
return True
return bool(len(element))
def _xupdateAppendAttributes(self, dict, path):
"""
......@@ -233,10 +231,10 @@ class ERP5Diff:
"""
# Make sure that they are elements.
if type(element1) != type(element2) or type(element1) != etree._Element:
return 0
return False
if element1.tag != element2.tag:
return 0
return False
id_list = []
for attr_map in (element1.attrib, element2.attrib):
......@@ -246,9 +244,9 @@ class ERP5Diff:
break
if len(id_list) == 0:
return 1
return True
if len(id_list) == 1:
return 0
return False
return (id_list[0] == id_list[1])
def _testAttributes(self, element1, element2, path):
......@@ -289,10 +287,10 @@ class ERP5Diff:
"""
for child in element:
if type(child) == etree._Element:
return 0
return False
if element.text is not None:
return 0
return 1
return False
return True
def _checkIgnoreText(self, element):
"""
......@@ -301,8 +299,8 @@ class ERP5Diff:
"""
for child in element:
if type(child) == etree._Element:
return 1
return 0
return True
return False
def _makeRelativePathList(self, element_list):
"""
......
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