Bläddra i källkod

learn to make tox happy

Tuna Celik 1 år sedan
förälder
incheckning
a72964ab3f
4 ändrade filer med 8 tillägg och 9 borttagningar
  1. 2 2
      radicale/app/base.py
  2. 2 2
      radicale/app/delete.py
  3. 2 4
      radicale/app/proppatch.py
  4. 2 1
      radicale/hook/__init__.py

+ 2 - 2
radicale/app/base.py

@@ -21,8 +21,8 @@ import sys
 import xml.etree.ElementTree as ET
 from typing import Optional
 
-from radicale import (auth, hook, config, httputils, pathutils, rights, storage,
-                      types, web, xmlutils)
+from radicale import (auth, config, hook, httputils, pathutils, rights,
+                      storage, types, web, xmlutils)
 from radicale.log import logger
 
 # HACK: https://github.com/tiran/defusedxml/issues/54

+ 2 - 2
radicale/app/delete.py

@@ -91,7 +91,7 @@ class ApplicationPartDelete(ApplicationBase):
                 )
                 xml_answer = xml_delete(
                     base_prefix, path, item.collection, item.href)
-            for i in hook_notification_item_list:
-                self._hook.notify(i)
+            for notification_item in hook_notification_item_list:
+                self._hook.notify(notification_item)
             headers = {"Content-Type": "text/xml; charset=%s" % self._encoding}
             return client.OK, headers, self._xml_response(xml_answer)

+ 2 - 4
radicale/app/proppatch.py

@@ -22,16 +22,14 @@ import xml.etree.ElementTree as ET
 from http import client
 from typing import Dict, Optional, cast
 
+import defusedxml.ElementTree as DefusedET
+
 import radicale.item as radicale_item
 from radicale import httputils, storage, types, xmlutils
 from radicale.app.base import Access, ApplicationBase
 from radicale.hook import HookNotificationItem, HookNotificationItemTypes
 from radicale.log import logger
 
-# HACK: https://github.com/tiran/defusedxml/issues/54
-import defusedxml.ElementTree as DefusedET  # isort:skip
-sys.modules["xml.etree"].ElementTree = ET  # type:ignore[attr-defined]
-
 
 def xml_proppatch(base_prefix: str, path: str,
                   xml_request: Optional[ET.Element],

+ 2 - 1
radicale/hook/__init__.py

@@ -1,9 +1,10 @@
 import json
 from enum import Enum
+from typing import Sequence
 
 from radicale import pathutils, utils
 
-INTERNAL_TYPES = ("none", "rabbitmq")
+INTERNAL_TYPES: Sequence[str] = ("none", "rabbitmq")
 
 
 def load(configuration):