소스 검색

Remove the useless ElementTree protected namespaces hack.

Guillaume Ayoub 16 년 전
부모
커밋
9a9342a1bd
1개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 7
      radicale/xmlutils.py

+ 2 - 7
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):