Enhance readability according to PEP8
This commit is contained in:
		| @@ -172,7 +172,7 @@ class Application(object): | |||||||
|     def __call__(self, environ, start_response): |     def __call__(self, environ, start_response): | ||||||
|         """Manage a request.""" |         """Manage a request.""" | ||||||
|         log.LOGGER.info("%s request at %s received" % ( |         log.LOGGER.info("%s request at %s received" % ( | ||||||
|                 environ["REQUEST_METHOD"], environ["PATH_INFO"])) |             environ["REQUEST_METHOD"], environ["PATH_INFO"])) | ||||||
|         headers = pprint.pformat(self.headers_log(environ)) |         headers = pprint.pformat(self.headers_log(environ)) | ||||||
|         log.LOGGER.debug("Request headers:\n%s" % headers) |         log.LOGGER.debug("Request headers:\n%s" % headers) | ||||||
|  |  | ||||||
| @@ -439,7 +439,7 @@ class Application(object): | |||||||
|         # Evolution bug workaround |         # Evolution bug workaround | ||||||
|         etag = environ.get("HTTP_IF_MATCH", "").replace("\\", "") |         etag = environ.get("HTTP_IF_MATCH", "").replace("\\", "") | ||||||
|         if (not item and not etag) or ( |         if (not item and not etag) or ( | ||||||
|             item and ((etag or item.etag) == item.etag)): |                 item and ((etag or item.etag) == item.etag)): | ||||||
|             # PUT allowed in 3 cases |             # PUT allowed in 3 cases | ||||||
|             # Case 1: No item and no ETag precondition: Add new item |             # Case 1: No item and no ETag precondition: Add new item | ||||||
|             # Case 2: Item and ETag precondition verified: Modify item |             # Case 2: Item and ETag precondition verified: Modify item | ||||||
|   | |||||||
| @@ -68,10 +68,10 @@ INITIAL_CONFIG = { | |||||||
|         "courier_socket": ""}, |         "courier_socket": ""}, | ||||||
|     "storage": { |     "storage": { | ||||||
|         "type": "filesystem", |         "type": "filesystem", | ||||||
|         "filesystem_folder": |         "filesystem_folder": os.path.expanduser( | ||||||
|             os.path.expanduser("~/.config/radicale/collections"), |             "~/.config/radicale/collections"), | ||||||
|         "git_folder": |         "git_folder": os.path.expanduser( | ||||||
|             os.path.expanduser("~/.config/radicale/collections")}, |             "~/.config/radicale/collections")}, | ||||||
|     "logging": { |     "logging": { | ||||||
|         "config": "/etc/radicale/logging", |         "config": "/etc/radicale/logging", | ||||||
|         "debug": "False", |         "debug": "False", | ||||||
|   | |||||||
| @@ -239,11 +239,10 @@ def _propfind_response(path, item, props, user): | |||||||
|             tag = ET.Element(_tag("D", "href")) |             tag = ET.Element(_tag("D", "href")) | ||||||
|             tag.text = path |             tag.text = path | ||||||
|             element.append(tag) |             element.append(tag) | ||||||
|         elif tag in ( |         elif tag in (_tag("D", "principal-collection-set"), | ||||||
|             _tag("D", "principal-collection-set"), |                      _tag("C", "calendar-user-address-set"), | ||||||
|             _tag("C", "calendar-user-address-set"), |                      _tag("CR", "addressbook-home-set"), | ||||||
|             _tag("CR", "addressbook-home-set"), |                      _tag("C", "calendar-home-set")): | ||||||
|             _tag("C", "calendar-home-set")): |  | ||||||
|             tag = ET.Element(_tag("D", "href")) |             tag = ET.Element(_tag("D", "href")) | ||||||
|             tag.text = path |             tag.text = path | ||||||
|             element.append(tag) |             element.append(tag) | ||||||
| @@ -269,8 +268,8 @@ def _propfind_response(path, item, props, user): | |||||||
|             element.append(privilege) |             element.append(privilege) | ||||||
|         elif tag == _tag("D", "supported-report-set"): |         elif tag == _tag("D", "supported-report-set"): | ||||||
|             for report_name in ( |             for report_name in ( | ||||||
|                 "principal-property-search", "sync-collection" |                     "principal-property-search", "sync-collection" | ||||||
|                 "expand-property", "principal-search-property-set"): |                     "expand-property", "principal-search-property-set"): | ||||||
|                 supported = ET.Element(_tag("D", "supported-report")) |                 supported = ET.Element(_tag("D", "supported-report")) | ||||||
|                 report_tag = ET.Element(_tag("D", "report")) |                 report_tag = ET.Element(_tag("D", "report")) | ||||||
|                 report_tag.text = report_name |                 report_tag.text = report_name | ||||||
| @@ -425,9 +424,8 @@ def report(path, xml_request, collection): | |||||||
|     props = [prop.tag for prop in prop_element] |     props = [prop.tag for prop in prop_element] | ||||||
|  |  | ||||||
|     if collection: |     if collection: | ||||||
|         if root.tag in ( |         if root.tag in (_tag("C", "calendar-multiget"), | ||||||
|             _tag("C", "calendar-multiget"), |                         _tag("CR", "addressbook-multiget")): | ||||||
|             _tag("CR", "addressbook-multiget")): |  | ||||||
|             # Read rfc4791-7.9 for info |             # Read rfc4791-7.9 for info | ||||||
|             hreferences = set( |             hreferences = set( | ||||||
|                 href_element.text for href_element |                 href_element.text for href_element | ||||||
| @@ -485,8 +483,8 @@ def report(path, xml_request, collection): | |||||||
|                 element = ET.Element(tag) |                 element = ET.Element(tag) | ||||||
|                 if tag == _tag("D", "getetag"): |                 if tag == _tag("D", "getetag"): | ||||||
|                     element.text = item.etag |                     element.text = item.etag | ||||||
|                 elif tag in ( |                 elif tag in (_tag("C", "calendar-data"), | ||||||
|                     _tag("C", "calendar-data"), _tag("CR", "address-data")): |                              _tag("CR", "address-data")): | ||||||
|                     if isinstance(item, ical.Component): |                     if isinstance(item, ical.Component): | ||||||
|                         element.text = ical.serialize( |                         element.text = ical.serialize( | ||||||
|                             collection_tag, collection_headers, |                             collection_tag, collection_headers, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Guillaume Ayoub
					Guillaume Ayoub