From 42ad18bc841702a2481302b127b291b005da4030 Mon Sep 17 00:00:00 2001 From: Unrud Date: Mon, 14 Sep 2020 21:17:18 +0200 Subject: [PATCH] Rename _write_xml_content to _xml_response --- radicale/app/__init__.py | 4 ++-- radicale/app/delete.py | 2 +- radicale/app/propfind.py | 2 +- radicale/app/proppatch.py | 3 +-- radicale/app/report.py | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/radicale/app/__init__.py b/radicale/app/__init__.py index 0f9ba95..30de725 100644 --- a/radicale/app/__init__.py +++ b/radicale/app/__init__.py @@ -345,7 +345,7 @@ class Application( xmlutils.pretty_xml(xml_content)) return xml_content - def _write_xml_content(self, xml_content): + def _xml_response(self, xml_content): if logger.isEnabledFor(logging.DEBUG): logger.debug("Response content:\n%s", xmlutils.pretty_xml(xml_content)) @@ -357,7 +357,7 @@ class Application( def _webdav_error_response(self, status, human_tag): """Generate XML error response.""" headers = {"Content-Type": "text/xml; charset=%s" % self._encoding} - content = self._write_xml_content(xmlutils.webdav_error(human_tag)) + content = self._xml_response(xmlutils.webdav_error(human_tag)) return status, headers, content diff --git a/radicale/app/delete.py b/radicale/app/delete.py index 8d08d30..df587a5 100644 --- a/radicale/app/delete.py +++ b/radicale/app/delete.py @@ -68,4 +68,4 @@ class ApplicationDeleteMixin: xml_answer = xml_delete( base_prefix, path, item.collection, item.href) headers = {"Content-Type": "text/xml; charset=%s" % self._encoding} - return client.OK, headers, self._write_xml_content(xml_answer) + return client.OK, headers, self._xml_response(xml_answer) diff --git a/radicale/app/propfind.py b/radicale/app/propfind.py index 7c45395..1c55b04 100644 --- a/radicale/app/propfind.py +++ b/radicale/app/propfind.py @@ -374,4 +374,4 @@ class ApplicationPropfindMixin: self._encoding) if status == client.FORBIDDEN and xml_answer is None: return httputils.NOT_ALLOWED - return status, headers, self._write_xml_content(xml_answer) + return status, headers, self._xml_response(xml_answer) diff --git a/radicale/app/proppatch.py b/radicale/app/proppatch.py index 53ab482..6fde5eb 100644 --- a/radicale/app/proppatch.py +++ b/radicale/app/proppatch.py @@ -116,5 +116,4 @@ class ApplicationProppatchMixin: logger.warning( "Bad PROPPATCH request on %r: %s", path, e, exc_info=True) return httputils.BAD_REQUEST - return (client.MULTI_STATUS, headers, - self._write_xml_content(xml_answer)) + return client.MULTI_STATUS, headers, self._xml_response(xml_answer) diff --git a/radicale/app/report.py b/radicale/app/report.py index 5da4c2e..30dac98 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -290,4 +290,4 @@ class ApplicationReportMixin: logger.warning( "Bad REPORT request on %r: %s", path, e, exc_info=True) return httputils.BAD_REQUEST - return (status, headers, self._write_xml_content(xml_answer)) + return status, headers, self._xml_response(xml_answer)