1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-08-01 18:18:31 +00:00

Rework XML helpers functions

- Merge make_tag, tag_from_clark and tag_from_human into make_clark and make_human
- Don't use RegEx for parsing
This commit is contained in:
Unrud 2020-01-19 18:53:05 +01:00
parent 262d76cc87
commit d3776e55fb
10 changed files with 200 additions and 198 deletions

View file

@ -374,10 +374,9 @@ class Application(
xml_declaration=True)
return f.getvalue()
def _webdav_error_response(self, namespace, name,
def _webdav_error_response(self, human_tag,
status=httputils.WEBDAV_PRECONDITION_FAILED[0]):
"""Generate XML error response."""
headers = {"Content-Type": "text/xml; charset=%s" % self._encoding}
content = self._write_xml_content(
xmlutils.webdav_error(namespace, name))
content = self._write_xml_content(xmlutils.webdav_error(human_tag))
return status, headers, content