Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5diff
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
erp5diff
Commits
eb3cfecd
Commit
eb3cfecd
authored
Oct 26, 2009
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use boolean instead of integer
parent
4aa4c4f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
ERP5Diff.py
ERP5Diff.py
+10
-12
No files found.
ERP5Diff.py
View file @
eb3cfecd
...
@@ -108,9 +108,7 @@ class ERP5Diff:
...
@@ -108,9 +108,7 @@ class ERP5Diff:
"""
"""
Check whether the element has any children
Check whether the element has any children
"""
"""
if
len
(
element
)
==
0
:
return
bool
(
len
(
element
))
return
False
return
True
def
_xupdateAppendAttributes
(
self
,
dict
,
path
):
def
_xupdateAppendAttributes
(
self
,
dict
,
path
):
"""
"""
...
@@ -233,10 +231,10 @@ class ERP5Diff:
...
@@ -233,10 +231,10 @@ class ERP5Diff:
"""
"""
# Make sure that they are elements.
# Make sure that they are elements.
if
type
(
element1
)
!=
type
(
element2
)
or
type
(
element1
)
!=
etree
.
_Element
:
if
type
(
element1
)
!=
type
(
element2
)
or
type
(
element1
)
!=
etree
.
_Element
:
return
0
return
False
if
element1
.
tag
!=
element2
.
tag
:
if
element1
.
tag
!=
element2
.
tag
:
return
0
return
False
id_list
=
[]
id_list
=
[]
for
attr_map
in
(
element1
.
attrib
,
element2
.
attrib
):
for
attr_map
in
(
element1
.
attrib
,
element2
.
attrib
):
...
@@ -246,9 +244,9 @@ class ERP5Diff:
...
@@ -246,9 +244,9 @@ class ERP5Diff:
break
break
if
len
(
id_list
)
==
0
:
if
len
(
id_list
)
==
0
:
return
1
return
True
if
len
(
id_list
)
==
1
:
if
len
(
id_list
)
==
1
:
return
0
return
False
return
(
id_list
[
0
]
==
id_list
[
1
])
return
(
id_list
[
0
]
==
id_list
[
1
])
def
_testAttributes
(
self
,
element1
,
element2
,
path
):
def
_testAttributes
(
self
,
element1
,
element2
,
path
):
...
@@ -289,10 +287,10 @@ class ERP5Diff:
...
@@ -289,10 +287,10 @@ class ERP5Diff:
"""
"""
for
child
in
element
:
for
child
in
element
:
if
type
(
child
)
==
etree
.
_Element
:
if
type
(
child
)
==
etree
.
_Element
:
return
0
return
False
if
element
.
text
is
not
None
:
if
element
.
text
is
not
None
:
return
0
return
False
return
1
return
True
def
_checkIgnoreText
(
self
,
element
):
def
_checkIgnoreText
(
self
,
element
):
"""
"""
...
@@ -301,8 +299,8 @@ class ERP5Diff:
...
@@ -301,8 +299,8 @@ class ERP5Diff:
"""
"""
for
child
in
element
:
for
child
in
element
:
if
type
(
child
)
==
etree
.
_Element
:
if
type
(
child
)
==
etree
.
_Element
:
return
1
return
True
return
0
return
False
def
_makeRelativePathList
(
self
,
element_list
):
def
_makeRelativePathList
(
self
,
element_list
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment