don't use operator
module
This commit is contained in:
parent
afc859dff7
commit
b942aeee23
2 changed files with 6 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
|||
import functools
|
||||
import logging
|
||||
import operator
|
||||
from datetime import datetime, timedelta
|
||||
from typing import cast
|
||||
|
||||
|
@ -42,7 +41,7 @@ class CalDAV:
|
|||
@property
|
||||
@asyncify
|
||||
@cachedmethod(
|
||||
cache=operator.attrgetter("_cache"),
|
||||
cache=lambda cls: cls._cache,
|
||||
key=functools.partial(davkey, "calendars"),
|
||||
)
|
||||
def calendars(cls) -> list[str]:
|
||||
|
@ -56,7 +55,7 @@ class CalDAV:
|
|||
@classmethod
|
||||
@asyncify
|
||||
@cachedmethod(
|
||||
cache=operator.attrgetter("_cache"),
|
||||
cache=lambda cls: cls._cache,
|
||||
key=functools.partial(davkey, "get_calendar"),
|
||||
)
|
||||
def get_calendar(cls, calendar_name: str) -> Calendar:
|
||||
|
@ -69,7 +68,7 @@ class CalDAV:
|
|||
@classmethod
|
||||
@asyncify
|
||||
@cachedmethod(
|
||||
cache=operator.attrgetter("_cache"),
|
||||
cache=lambda cls: cls._cache,
|
||||
key=functools.partial(davkey, "get_events"),
|
||||
)
|
||||
def get_events(cls, calendar_name: str, cfg: Config) -> list[CalEvent]:
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import functools
|
||||
import logging
|
||||
import operator
|
||||
import re
|
||||
from io import BytesIO
|
||||
|
||||
|
@ -56,7 +55,7 @@ class WebDAV:
|
|||
@classmethod
|
||||
@asyncify
|
||||
@cachedmethod(
|
||||
cache=operator.attrgetter("_cache"),
|
||||
cache=lambda cls: cls._cache,
|
||||
key=functools.partial(davkey, "list_files"),
|
||||
)
|
||||
def list_files(
|
||||
|
@ -77,7 +76,7 @@ class WebDAV:
|
|||
@classmethod
|
||||
@asyncify
|
||||
@cachedmethod(
|
||||
cache=operator.attrgetter("_cache"),
|
||||
cache=lambda cls: cls._cache,
|
||||
key=functools.partial(davkey, "exists"),
|
||||
)
|
||||
def exists(cls, path: str) -> bool:
|
||||
|
@ -91,7 +90,7 @@ class WebDAV:
|
|||
@classmethod
|
||||
@asyncify
|
||||
@cachedmethod(
|
||||
cache=operator.attrgetter("_cache"),
|
||||
cache=lambda cls: cls._cache,
|
||||
key=functools.partial(davkey, "read_bytes"),
|
||||
)
|
||||
def read_bytes(cls, path: str) -> bytes:
|
||||
|
|
Loading…
Reference in a new issue