Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
1bb6f655
Commit
1bb6f655
authored
Nov 02, 2004
by
Sidnei da Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge second patch from Simon to issue #1443
parent
45e5350a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
11 deletions
+26
-11
lib/python/webdav/xmltools.py
lib/python/webdav/xmltools.py
+26
-11
No files found.
lib/python/webdav/xmltools.py
View file @
1bb6f655
...
@@ -19,14 +19,19 @@ __version__='$Revision: 1.15.2.1 $'[11:-2]
...
@@ -19,14 +19,19 @@ __version__='$Revision: 1.15.2.1 $'[11:-2]
"""
"""
TODO:
TODO:
- Check the methods Node.addNode
, Node.remap and Node del_attr
- Check the methods Node.addNode
and find out if some code uses/requires th
ese methods
.
and find out if some code uses/requires th
is method
.
=> If yes implement them, else forget them.
=> If yes implement them, else forget them.
NOTE: So far i didn't have any problems.
NOTE: So far i didn't have any problems.
If you have problems please report them.
If you have problems please report them.
- We are using a hardcoded default of latin-1 for encoding unicode
strings. While this is suboptimal, it does match the expected
encoding from OFS.PropertySheet. We need to find a the encoding
somehow, maybe use the same encoding as the ZMI is using?
"""
"""
from
xml.dom
import
minidom
from
xml.dom
import
minidom
...
@@ -92,24 +97,34 @@ class Node:
...
@@ -92,24 +97,34 @@ class Node:
return
self
.
toxml
().
encode
(
zope_encoding
)
return
self
.
toxml
().
encode
(
zope_encoding
)
def
name
(
self
):
return
self
.
node
.
localName
def
name
(
self
):
return
self
.
node
.
localName
def
attrs
(
self
):
return
self
.
node
.
attributes
def
value
(
self
):
return
self
.
node
.
nodeValue
def
value
(
self
):
return
self
.
node
.
nodeValue
def
nodes
(
self
):
return
self
.
node
.
childNodes
def
nodes
(
self
):
return
self
.
node
.
childNodes
def
nskey
(
self
):
return
self
.
node
.
namespaceURI
def
nskey
(
self
):
return
self
.
node
.
namespaceURI
def
namespace
(
self
):
return
self
.
nskey
()
def
namespace
(
self
):
return
self
.
nskey
()
def
attrs
(
self
):
return
[
Node
(
n
)
for
n
in
self
.
node
.
attributes
.
values
()]
def
del_attr
(
self
,
name
):
def
del_attr
(
self
,
name
):
# XXX: no support for removing attributes
# NOTE: zope calls this after remapping to remove namespace
# zope can calls this after remapping to remove namespace
# zope passes attributes like xmlns:n
# haven't seen this happening though
# but the :n isnt part of the attribute name .. gash!
return
None
attr
=
name
.
split
(
':'
)[
0
]
return
self
.
node
.
removeAttribute
(
attr
)
def
remap
(
self
,
dict
,
n
=
0
,
top
=
1
):
def
remap
(
self
,
dict
,
n
=
0
,
top
=
1
):
# XXX: this method is used to do some strange remapping of elements
# XXX: this method is used to do some strange remapping of elements
# and namespaces .. not sure how to do this with minidom
# and namespaces .. someone wants to explain that code?
# and if this is even required for something
# zope calls this to change namespaces in PropPatch and Lock
# XXX: i also dont understand why this method returns anything
# as the return value is never used
# NOTE: zope calls this to change namespaces in PropPatch and Lock
# we dont need any fancy remapping here and simply remove
# the attributes in del_attr
return
{},
0
return
{},
0
def
__repr__
(
self
):
def
__repr__
(
self
):
...
...
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