From 46fcec8fe04f104e887e5602a0f8ffc97369bee3 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sun, 26 Feb 2017 16:19:38 +0100 Subject: [PATCH] Cosmetics --- radicale/__init__.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 8fb4adc..9354287 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -299,7 +299,10 @@ class Application: time_end = datetime.datetime.now() status = "%i %s" % ( status, client.responses.get(status, "Unknown")) - self.logger.info("%s answer status for %s in %s sec: %s", environ["REQUEST_METHOD"], environ["PATH_INFO"] + depthinfo, (time_end - time_begin).total_seconds(), status) + self.logger.info( + "%s answer status for %s in %s sec: %s", + environ["REQUEST_METHOD"], environ["PATH_INFO"] + depthinfo, + (time_end - time_begin).total_seconds(), status) start_response(status, list(headers.items())) # Return response content return [answer] if answer else [] @@ -320,16 +323,19 @@ class Application: if environ["HTTP_DEPTH"]: depthinfo = " with depth " + environ["HTTP_DEPTH"] time_begin = datetime.datetime.now() - self.logger.info("%s request for %s received from %s using \"%s\"", - environ["REQUEST_METHOD"], environ["PATH_INFO"] + depthinfo, remote_host, remote_useragent) + self.logger.info( + "%s request for %s received from %s using \"%s\"", + environ["REQUEST_METHOD"], environ["PATH_INFO"] + depthinfo, + remote_host, remote_useragent) headers = pprint.pformat(self.headers_log(environ)) self.logger.debug("Request headers:\n%s", headers) # Let reverse proxies overwrite SCRIPT_NAME if "HTTP_X_SCRIPT_NAME" in environ: environ["SCRIPT_NAME"] = environ["HTTP_X_SCRIPT_NAME"] - self.logger.debug("Script name overwritten by client: %s", - environ["SCRIPT_NAME"]) + self.logger.debug( + "Script name overwritten by client: %s", + environ["SCRIPT_NAME"]) # Sanitize base prefix environ["SCRIPT_NAME"] = storage.sanitize_path( environ.get("SCRIPT_NAME", "")).rstrip("/")