[Zope-CVS] CVS: Packages/Moztop/moztopsupport/dav - propfind.py:1.11 views.py:1.9
Sidnei da Silva
sidnei@x3ng.com.br
Wed, 2 Apr 2003 15:38:20 -0500
Update of /cvs-repository/Packages/Moztop/moztopsupport/dav
In directory cvs.zope.org:/tmp/cvs-serv7177/moztopsupport/dav
Modified Files:
propfind.py views.py
Log Message:
Changing everything to have a xmlns
=== Packages/Moztop/moztopsupport/dav/propfind.py 1.10 => 1.11 ===
--- Packages/Moztop/moztopsupport/dav/propfind.py:1.10 Wed Apr 2 14:56:22 2003
+++ Packages/Moztop/moztopsupport/dav/propfind.py Wed Apr 2 15:38:19 2003
@@ -62,29 +62,35 @@
xmldoc = minidom.parse(data)
response = minidom.Document()
- ms = response.createElementNS(default_ns, 'D:multistatus')
- ms.setAttributeNS(default_ns, 'xmlns:D', 'DAV:')
+ ms = response.createElement('multistatus')
+ ms.setAttribute('xmlns', default_ns)
response.appendChild(ms)
- re = response.createElementNS(default_ns, 'D:response')
+ re = response.createElement('response')
+ re.setAttribute('xmlns', default_ns)
ms.appendChild(re)
- href = response.createElementNS(default_ns, 'D:href')
+ href = response.createElement('href')
+ href.setAttribute('xmlns', default_ns)
re.appendChild(href)
r_url = response.createTextNode(resource_url)
href.appendChild(r_url)
propname = xmldoc.getElementsByTagNameNS(default_ns, 'propname')
if propname:
- pstat = response.createElementNS(default_ns, 'D:propstat')
+ pstat = response.createElement('propstat')
+ pstat.setAttribute('xmlns', default_ns)
re.appendChild(pstat)
- prop = response.createElementNS(default_ns, 'D:prop')
+ prop = response.createElement('prop')
+ prop.setAttribute('xmlns', default_ns)
pstat.appendChild(prop)
for p in _avail_props:
view = queryView(self.context, \
'DAV%s' % p, self.request, None)
if view is not None:
- el = response.createElementNS(default_ns, 'D:%s' % p )
+ el = response.createElement('%s' % p )
+ el.setAttribute('xmlns', default_ns)
prop.appendChild(el)
- status = response.createElementNS(default_ns, 'D:status')
+ status = response.createElement('status')
+ status.setAttribute('xmlns', default_ns)
pstat.appendChild(status)
text = response.createTextNode('HTTP/1.1 200 OK')
status.appendChild(text)
@@ -118,24 +124,27 @@
avail[localname] = str(view)
if avail:
- pstat = response.createElementNS(default_ns, 'D:propstat')
+ pstat = response.createElement('propstat')
+ pstat.setAttribute('xmlns', default_ns)
re.appendChild(pstat)
- prop = response.createElementNS(default_ns, 'D:prop')
+ prop = response.createElement('prop')
+ prop.setAttribute('xmlns', default_ns)
pstat.appendChild(prop)
- status = response.createElementNS(default_ns, 'D:status')
+ status = response.createElement('status')
+ status.setAttribute('xmlns', default_ns)
pstat.appendChild(status)
text = response.createTextNode('HTTP/1.1 200 OK')
status.appendChild(text)
for p in avail.keys():
ns = props_ns.get(p, None)
+ el = response.createElement('%s' % p )
if ns is not None:
- el = response.createElementNS(ns, '%s' % p )
el.setAttribute('xmlns', ns)
else:
- el = response.createElementNS(default_ns, 'D:%s' % p )
+ el.setAttribute('xmlns', default_ns)
+
prop.appendChild(el)
-
try:
value = minidom.parseString(avail[p]).documentElement
except:
@@ -144,16 +153,20 @@
el.appendChild(value)
if not_avail:
- pstat = response.createElementNS(default_ns, 'D:propstat')
+ pstat = response.createElement('propstat')
+ pstat.setAttribute('xmlns', default_ns)
re.appendChild(pstat)
- prop = response.createElementNS(default_ns, 'D:prop')
+ prop = response.createElement('prop')
+ prop.setAttribute('xmlns', default_ns)
pstat.appendChild(prop)
- status = response.createElementNS(default_ns, 'D:status')
+ status = response.createElement('status')
+ status.setAttribute('xmlns', default_ns)
pstat.appendChild(status)
text = response.createTextNode('HTTP/1.1 403 Forbidden')
status.appendChild(text)
for p in not_avail:
- el = response.createElementNS(default_ns, 'D:%s' % p )
+ el = response.createElement('%s' % p )
+ el.setAttribute('xmlns', default_ns)
prop.appendChild(el)
depth = self.getDepth()
=== Packages/Moztop/moztopsupport/dav/views.py 1.8 => 1.9 ===
--- Packages/Moztop/moztopsupport/dav/views.py:1.8 Wed Apr 2 15:11:50 2003
+++ Packages/Moztop/moztopsupport/dav/views.py Wed Apr 2 15:38:19 2003
@@ -18,13 +18,16 @@
resource_url = str(getView(self.context, 'absolute_url', self.request))
source_url = '%s/@@source.html' % resource_url
xml = minidom.Document()
- link = xml.createElementNS('DAV:', 'D:link')
+ link = xml.createElement('link')
+ link.setAttribute('xmlns', 'DAV:')
xml.appendChild(link)
- src = xml.createElementNS('DAV:', 'D:src')
+ src = xml.createElement('src')
+ src.setAttribute('xmlns', 'DAV:')
link.appendChild(src)
r_url = xml.createTextNode(resource_url)
src.appendChild(r_url)
- dst = xml.createElementNS('DAV:', 'D:dst')
+ dst = xml.createElement('dst')
+ dst.setAttribute('xmlns', 'DAV:')
link.appendChild(dst)
s_url = xml.createTextNode(source_url)
dst.appendChild(s_url)