From 9a9342a1bd77f1bddb548a6f28f276cff025915f Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sat, 10 Apr 2010 16:26:22 +0200 Subject: [PATCH] Remove the useless ElementTree protected namespaces hack. --- radicale/xmlutils.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index e22511ea..c65e9b35 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -34,20 +34,15 @@ import xml.etree.ElementTree as ET from radicale import client, config, ical -# TODO: This is a well-known and accepted hack for ET to avoid ET from renaming -# namespaces, which is accepted in XML norm but often not in XML -# readers. Is there another clean solution to force namespaces? -PROTECTED_NAMESPACES = { +NAMESPACES = { "C": "urn:ietf:params:xml:ns:caldav", "D": "DAV:", "CS": "http://calendarserver.org/ns/"} -for key, value in PROTECTED_NAMESPACES.items(): - ET._namespace_map[value] = key def _tag(short_name, local): """Get XML Clark notation {uri(``short_name``)}``local``.""" - return "{%s}%s" % (PROTECTED_NAMESPACES[short_name], local) + return "{%s}%s" % (NAMESPACES[short_name], local) def _response(code):