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
bf028670
Commit
bf028670
authored
Sep 26, 2007
by
Nicolas Delaby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 4Suite Library instead minidom if avalaible
parent
b689249b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
ERP5Diff.py
ERP5Diff.py
+12
-13
No files found.
ERP5Diff.py
View file @
bf028670
...
...
@@ -20,7 +20,11 @@
#
##############################################################################
from
xml.dom.minidom
import
parse
,
parseString
,
getDOMImplementation
from
xml.dom.minidom
import
parseString
,
getDOMImplementation
try
:
from
Ft.Xml
import
Parse
as
parse
except
:
from
xml.dom.minidom
import
parse
import
sys
import
getopt
import
os
...
...
@@ -180,8 +184,7 @@ class ERP5Diff:
child_element
=
createElement
(
'xupdate:element'
)
child_element
.
setAttribute
(
'name'
,
element
.
tagName
)
attr_map
=
element
.
attributes
for
i
in
range
(
attr_map
.
length
):
attr
=
attr_map
.
item
(
i
)
for
attr
in
attr_map
.
values
():
attr_element
=
createElement
(
'xupdate:attribute'
)
attr_element
.
setAttribute
(
'name'
,
attr
.
name
)
text_node
=
createTextNode
(
attr
.
nodeValue
)
...
...
@@ -206,8 +209,7 @@ class ERP5Diff:
child_element
=
createElement
(
'xupdate:element'
)
child_element
.
setAttribute
(
'name'
,
element
.
tagName
)
attr_map
=
element
.
attributes
for
i
in
range
(
attr_map
.
length
):
attr
=
attr_map
.
item
(
i
)
for
attr
in
attr_map
.
values
():
attr_element
=
createElement
(
'xupdate:attribute'
)
attr_element
.
setAttribute
(
'name'
,
attr
.
name
)
text_node
=
createTextNode
(
attr
.
nodeValue
)
...
...
@@ -232,8 +234,7 @@ class ERP5Diff:
id_list
=
[]
for
attr_map
in
(
element1
.
attributes
,
element2
.
attributes
):
for
i
in
range
(
attr_map
.
length
):
attr
=
attr_map
.
item
(
i
)
for
attr
in
attr_map
.
values
():
if
attr
.
name
==
'id'
:
id_list
.
append
(
attr
.
nodeValue
)
break
...
...
@@ -252,8 +253,7 @@ class ERP5Diff:
dict_list
=
[]
for
attr_map
in
(
element1
.
attributes
,
element2
.
attributes
):
dict
=
{}
for
i
in
range
(
attr_map
.
length
):
attr
=
attr_map
.
item
(
i
)
for
attr
in
attr_map
.
values
():
dict
[
attr
.
name
]
=
attr
.
nodeValue
dict_list
.
append
(
dict
)
dict1
,
dict2
=
dict_list
...
...
@@ -314,8 +314,7 @@ class ERP5Diff:
# Check if this element has an attribute 'id'.
id_val
=
None
attr_map
=
element
.
attributes
for
i
in
range
(
attr_map
.
length
):
attr
=
attr_map
.
item
(
i
)
for
attr
in
attr_map
.
values
():
if
attr
.
name
==
'id'
:
id_val
=
attr
.
nodeValue
break
...
...
@@ -444,8 +443,8 @@ class ERP5Diff:
self
.
_testAttributes
(
old_root_element
,
new_root_element
,
'/'
)
self
.
_xupdateUpdateElement
(
new_root_element
,
'/'
)
finally
:
old_doc
.
unlink
()
new_doc
.
unlink
()
del
old_doc
del
new_doc
def
output
(
self
,
file
=
None
):
"""
...
...
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