From 47bc966a13d438b94f0e923f93ee3b7ba64dabc1 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Wed, 24 Jul 2024 11:22:49 +0200 Subject: [PATCH] fix misspellings --- radicale/__main__.py | 2 +- radicale/app/__init__.py | 2 +- radicale/app/propfind.py | 6 +++--- radicale/app/report.py | 2 +- radicale/auth/htpasswd.py | 2 +- radicale/item/__init__.py | 2 +- radicale/item/filter.py | 2 +- radicale/rights/from_file.py | 2 +- radicale/storage/multifilesystem/get.py | 6 +++--- radicale/tests/__init__.py | 10 +++++----- radicale/tests/test_base.py | 10 +++++----- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/radicale/__main__.py b/radicale/__main__.py index f2f157b9f..a58b8c946 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -183,7 +183,7 @@ def exit_signal_handler(signal_number: int, storage_ = storage.load(configuration) with storage_.acquire_lock("r"): if not storage_.verify(): - logger.critical("Storage verifcation failed") + logger.critical("Storage verification failed") sys.exit(1) except Exception as e: logger.critical("An exception occurred during storage " diff --git a/radicale/app/__init__.py b/radicale/app/__init__.py index 3b8d18002..5fe71d306 100644 --- a/radicale/app/__init__.py +++ b/radicale/app/__init__.py @@ -232,7 +232,7 @@ def response(status: int, headers: types.WSGIResponseHeaders, path.rstrip("/").endswith("/.well-known/carddav")): return response(*httputils.redirect( base_prefix + "/", client.MOVED_PERMANENTLY)) - # Return NOT FOUND for all other paths containing ".well-knwon" + # Return NOT FOUND for all other paths containing ".well-known" if path.endswith("/.well-known") or "/.well-known/" in path: return response(*httputils.NOT_FOUND) diff --git a/radicale/app/propfind.py b/radicale/app/propfind.py index b1cfc197f..009c61dca 100644 --- a/radicale/app/propfind.py +++ b/radicale/app/propfind.py @@ -322,13 +322,13 @@ def xml_propfind_response( responses[404 if is404 else 200].append(element) - for status_code, childs in responses.items(): - if not childs: + for status_code, children in responses.items(): + if not children: continue propstat = ET.Element(xmlutils.make_clark("D:propstat")) response.append(propstat) prop = ET.Element(xmlutils.make_clark("D:prop")) - prop.extend(childs) + prop.extend(children) propstat.append(prop) status = ET.Element(xmlutils.make_clark("D:status")) status.text = xmlutils.make_response(status_code) diff --git a/radicale/app/report.py b/radicale/app/report.py index 8a9474321..f0c50214f 100644 --- a/radicale/app/report.py +++ b/radicale/app/report.py @@ -271,7 +271,7 @@ def _make_vobject_expanded_item( if hasattr(item.vobject_item.vevent, 'rrule'): rruleset = vevent.getrruleset() - # There is something strage behavour during serialization native datetime, so converting manualy + # There is something strange behaviour during serialization native datetime, so converting manually vevent.dtstart.value = vevent.dtstart.value.strftime(dt_format) if dt_end is not None: vevent.dtend.value = vevent.dtend.value.strftime(dt_format) diff --git a/radicale/auth/htpasswd.py b/radicale/auth/htpasswd.py index 689bb0fba..7422e16df 100644 --- a/radicale/auth/htpasswd.py +++ b/radicale/auth/htpasswd.py @@ -36,7 +36,7 @@ the password encryption method specified via the ``htpasswd_encryption`` configuration value. -The following htpasswd password encrpytion methods are supported by Radicale +The following htpasswd password encryption methods are supported by Radicale out-of-the-box: - plain-text (created by htpasswd -p ...) -- INSECURE - MD5-APR1 (htpasswd -m ...) -- htpasswd's default method, INSECURE diff --git a/radicale/item/__init__.py b/radicale/item/__init__.py index c10824a6f..a05304ffc 100644 --- a/radicale/item/__init__.py +++ b/radicale/item/__init__.py @@ -304,7 +304,7 @@ def find_time_range(vobject_item: vobject.base.Component, tag: str Returns a tuple (``start``, ``end``) where ``start`` and ``end`` are POSIX timestamps. - This is intened to be used for matching against simplified prefilters. + This is intended to be used for matching against simplified prefilters. """ if not tag: diff --git a/radicale/item/filter.py b/radicale/item/filter.py index 0b3d01ef9..141845ceb 100644 --- a/radicale/item/filter.py +++ b/radicale/item/filter.py @@ -199,7 +199,7 @@ def visit_time_ranges(vobject_item: vobject.base.Component, child_name: str, """ - # HACK: According to rfc5545-3.8.4.4 an recurrance that is resheduled + # HACK: According to rfc5545-3.8.4.4 a recurrence that is rescheduled # with Recurrence ID affects the recurrence itself and all following # recurrences too. This is not respected and client don't seem to bother # either. diff --git a/radicale/rights/from_file.py b/radicale/rights/from_file.py index 3b8ede053..d766d1dd1 100644 --- a/radicale/rights/from_file.py +++ b/radicale/rights/from_file.py @@ -22,7 +22,7 @@ The login is matched against the "user" key, and the collection path is matched against the "collection" key. In the "collection" regex you can use `{user}` and get groups from the "user" regex with `{0}`, `{1}`, etc. -In consequence of the parameter subsitution you have to write `{{` and `}}` +In consequence of the parameter substitution you have to write `{{` and `}}` if you want to use regular curly braces in the "user" and "collection" regexes. For example, for the "user" key, ".+" means "authenticated user" and ".*" diff --git a/radicale/storage/multifilesystem/get.py b/radicale/storage/multifilesystem/get.py index c52c1f7ed..f5d258161 100644 --- a/radicale/storage/multifilesystem/get.py +++ b/radicale/storage/multifilesystem/get.py @@ -84,7 +84,7 @@ def _get(self, href: str, verify_href: bool = True cache_content = self._load_item_cache(href, cache_hash) if cache_content is None: with self._acquire_cache_lock("item"): - # Lock the item cache to prevent multpile processes from + # Lock the item cache to prevent multiple processes from # generating the same data in parallel. # This improves the performance for multiple requests. if self._storage._lock.locked == "r": @@ -127,7 +127,7 @@ def _get(self, href: str, verify_href: bool = True def get_multi(self, hrefs: Iterable[str] ) -> Iterator[Tuple[str, Optional[radicale_item.Item]]]: - # It's faster to check for file name collissions here, because + # It's faster to check for file name collisions here, because # we only need to call os.listdir once. files = None for href in hrefs: @@ -146,7 +146,7 @@ def get_multi(self, hrefs: Iterable[str] def get_all(self) -> Iterator[radicale_item.Item]: for href in self._list(): - # We don't need to check for collissions, because the file names + # We don't need to check for collisions, because the file names # are from os.listdir. item = self._get(href, verify_href=False) if item is not None: diff --git a/radicale/tests/__init__.py b/radicale/tests/__init__.py index 63cfda04a..528a98b29 100644 --- a/radicale/tests/__init__.py +++ b/radicale/tests/__init__.py @@ -112,7 +112,7 @@ def parse_responses(text: str) -> RESPONSES: for response in xml.findall(xmlutils.make_clark("D:response")): href = response.find(xmlutils.make_clark("D:href")) assert href.text not in path_responses - prop_respones: Dict[str, Tuple[int, ET.Element]] = {} + prop_responses: Dict[str, Tuple[int, ET.Element]] = {} for propstat in response.findall( xmlutils.make_clark("D:propstat")): status = propstat.find(xmlutils.make_clark("D:status")) @@ -121,16 +121,16 @@ def parse_responses(text: str) -> RESPONSES: for element in propstat.findall( "./%s/*" % xmlutils.make_clark("D:prop")): human_tag = xmlutils.make_human_tag(element.tag) - assert human_tag not in prop_respones - prop_respones[human_tag] = (status_code, element) + assert human_tag not in prop_responses + prop_responses[human_tag] = (status_code, element) status = response.find(xmlutils.make_clark("D:status")) if status is not None: - assert not prop_respones + assert not prop_responses assert status.text.startswith("HTTP/1.1 ") status_code = int(status.text.split(" ")[1]) path_responses[href.text] = status_code else: - path_responses[href.text] = prop_respones + path_responses[href.text] = prop_responses return path_responses def get(self, path: str, check: Optional[int] = 200, **kwargs diff --git a/radicale/tests/test_base.py b/radicale/tests/test_base.py index d591773da..dd2a25348 100644 --- a/radicale/tests/test_base.py +++ b/radicale/tests/test_base.py @@ -359,7 +359,7 @@ def test_move(self) -> None: self.get(path1, check=404) self.get(path2) - def test_move_between_colections(self) -> None: + def test_move_between_collections(self) -> None: """Move a item.""" self.mkcalendar("/calendar1.ics/") self.mkcalendar("/calendar2.ics/") @@ -372,7 +372,7 @@ def test_move_between_colections(self) -> None: self.get(path1, check=404) self.get(path2) - def test_move_between_colections_duplicate_uid(self) -> None: + def test_move_between_collections_duplicate_uid(self) -> None: """Move a item to a collection which already contains the UID.""" self.mkcalendar("/calendar1.ics/") self.mkcalendar("/calendar2.ics/") @@ -388,7 +388,7 @@ def test_move_between_colections_duplicate_uid(self) -> None: assert xml.tag == xmlutils.make_clark("D:error") assert xml.find(xmlutils.make_clark("C:no-uid-conflict")) is not None - def test_move_between_colections_overwrite(self) -> None: + def test_move_between_collections_overwrite(self) -> None: """Move a item to a collection which already contains the item.""" self.mkcalendar("/calendar1.ics/") self.mkcalendar("/calendar2.ics/") @@ -402,8 +402,8 @@ def test_move_between_colections_overwrite(self) -> None: self.request("MOVE", path1, check=204, HTTP_OVERWRITE="T", HTTP_DESTINATION="http://127.0.0.1/"+path2) - def test_move_between_colections_overwrite_uid_conflict(self) -> None: - """Move a item to a collection which already contains the item with + def test_move_between_collections_overwrite_uid_conflict(self) -> None: + """Move an item to a collection which already contains the item with a different UID.""" self.mkcalendar("/calendar1.ics/") self.mkcalendar("/calendar2.ics/")