mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Avoid using mutable class attributes
A tuple works fine here.
This commit is contained in:
parent
ffe883a2f1
commit
ed88406aec
5 changed files with 5 additions and 5 deletions
|
|
@ -75,7 +75,7 @@ class Storage(metaclass=StorageMeta):
|
||||||
read_only = False
|
read_only = False
|
||||||
|
|
||||||
# The attribute values to show in the representation of the storage.
|
# The attribute values to show in the representation of the storage.
|
||||||
_repr_attributes: list[str] = []
|
_repr_attributes: tuple[str, ...] = ()
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,7 @@ class DAVStorage(Storage):
|
||||||
|
|
||||||
connector: aiohttp.TCPConnector
|
connector: aiohttp.TCPConnector
|
||||||
|
|
||||||
_repr_attributes = ["username", "url"]
|
_repr_attributes = ("username", "url")
|
||||||
|
|
||||||
_property_table = {
|
_property_table = {
|
||||||
"displayname": ("displayname", "DAV:"),
|
"displayname": ("displayname", "DAV:"),
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class FilesystemStorage(Storage):
|
class FilesystemStorage(Storage):
|
||||||
storage_name = "filesystem"
|
storage_name = "filesystem"
|
||||||
_repr_attributes = ["path"]
|
_repr_attributes = ("path",)
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
|
||||||
class HttpStorage(Storage):
|
class HttpStorage(Storage):
|
||||||
storage_name = "http"
|
storage_name = "http"
|
||||||
read_only = True
|
read_only = True
|
||||||
_repr_attributes = ["username", "url"]
|
_repr_attributes = ("username", "url")
|
||||||
_items = None
|
_items = None
|
||||||
|
|
||||||
# Required for tests.
|
# Required for tests.
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ def _writing_op(f):
|
||||||
|
|
||||||
class SingleFileStorage(Storage):
|
class SingleFileStorage(Storage):
|
||||||
storage_name = "singlefile"
|
storage_name = "singlefile"
|
||||||
_repr_attributes = ["path"]
|
_repr_attributes = ("path",)
|
||||||
|
|
||||||
_write_mode = "wb"
|
_write_mode = "wb"
|
||||||
_append_mode = "ab"
|
_append_mode = "ab"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue