mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Pre-commit autoupdate
This commit is contained in:
parent
7991419ab1
commit
42c5dba208
9 changed files with 22 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.4.0
|
rev: v4.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
args: [--markdown-linebreak-ext=md]
|
args: [--markdown-linebreak-ext=md]
|
||||||
|
|
@ -9,11 +9,11 @@ repos:
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- id: debug-statements
|
- id: debug-statements
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: "23.9.1"
|
rev: "24.1.1"
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: "v1.5.1"
|
rev: "v1.8.0"
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
files: vdirsyncer/.*
|
files: vdirsyncer/.*
|
||||||
|
|
@ -23,7 +23,7 @@ repos:
|
||||||
- types-requests
|
- types-requests
|
||||||
- types-atomicwrites
|
- types-atomicwrites
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
rev: 'v0.0.291'
|
rev: 'v0.1.15'
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix, --exit-non-zero-on-fix]
|
args: [--fix, --exit-non-zero-on-fix]
|
||||||
|
|
|
||||||
1
setup.py
1
setup.py
|
|
@ -4,6 +4,7 @@ Vdirsyncer synchronizes calendars and contacts.
|
||||||
Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for
|
Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for
|
||||||
how to package vdirsyncer.
|
how to package vdirsyncer.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from setuptools import Command
|
from setuptools import Command
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"""
|
"""
|
||||||
Test suite for vdirsyncer.
|
Test suite for vdirsyncer.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import hypothesis.strategies as st
|
import hypothesis.strategies as st
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"""
|
"""
|
||||||
General-purpose fixtures for vdirsyncer's testsuite.
|
General-purpose fixtures for vdirsyncer's testsuite.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
"""
|
"""
|
||||||
Vdirsyncer synchronizes calendars and contacts.
|
Vdirsyncer synchronizes calendars and contacts.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
PROJECT_HOME = "https://github.com/pimutils/vdirsyncer"
|
PROJECT_HOME = "https://github.com/pimutils/vdirsyncer"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
Contains exception classes used by vdirsyncer. Not all exceptions are here,
|
Contains exception classes used by vdirsyncer. Not all exceptions are here,
|
||||||
only the most commonly used ones.
|
only the most commonly used ones.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ class StorageMeta(ABCMeta):
|
||||||
|
|
||||||
|
|
||||||
class Storage(metaclass=StorageMeta):
|
class Storage(metaclass=StorageMeta):
|
||||||
|
|
||||||
"""Superclass of all storages, interface that all storages have to
|
"""Superclass of all storages, interface that all storages have to
|
||||||
implement.
|
implement.
|
||||||
|
|
||||||
|
|
@ -67,8 +66,8 @@ class Storage(metaclass=StorageMeta):
|
||||||
# The machine-readable name of this collection.
|
# The machine-readable name of this collection.
|
||||||
collection = None
|
collection = None
|
||||||
|
|
||||||
#A value of False means storage does not support delete requests. A
|
# A value of False means storage does not support delete requests. A
|
||||||
#value of True mean the storage supports it.
|
# value of True mean the storage supports it.
|
||||||
no_delete = False
|
no_delete = False
|
||||||
|
|
||||||
# A value of True means the storage does not support write-methods such as
|
# A value of True means the storage does not support write-methods such as
|
||||||
|
|
@ -79,7 +78,13 @@ class Storage(metaclass=StorageMeta):
|
||||||
# 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: list[str] = []
|
||||||
|
|
||||||
def __init__(self, instance_name=None, read_only=None, no_delete=None, collection=None):
|
def __init__(
|
||||||
|
self,
|
||||||
|
instance_name=None,
|
||||||
|
read_only=None,
|
||||||
|
no_delete=None,
|
||||||
|
collection=None,
|
||||||
|
):
|
||||||
if read_only is None:
|
if read_only is None:
|
||||||
read_only = self.read_only
|
read_only = self.read_only
|
||||||
if self.read_only and not read_only:
|
if self.read_only and not read_only:
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ Yang: http://blog.ezyang.com/2012/08/how-offlineimap-works/
|
||||||
Some modifications to it are explained in
|
Some modifications to it are explained in
|
||||||
https://unterwaditzer.net/2016/sync-algorithm.html
|
https://unterwaditzer.net/2016/sync-algorithm.html
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|
@ -244,7 +245,9 @@ class Delete(Action):
|
||||||
async def _run_impl(self, a, b):
|
async def _run_impl(self, a, b):
|
||||||
meta = self.dest.status.get_new(self.ident)
|
meta = self.dest.status.get_new(self.ident)
|
||||||
if self.dest.storage.read_only or self.dest.storage.no_delete:
|
if self.dest.storage.read_only or self.dest.storage.no_delete:
|
||||||
sync_logger.debug(f"Skipping deletion of item {self.ident} from {self.dest.storage}")
|
sync_logger.debug(
|
||||||
|
f"Skipping deletion of item {self.ident} from {self.dest.storage}"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
sync_logger.info(f"Deleting item {self.ident} from {self.dest.storage}")
|
sync_logger.info(f"Deleting item {self.ident} from {self.dest.storage}")
|
||||||
await self.dest.storage.delete(meta.href, meta.etag)
|
await self.dest.storage.delete(meta.href, meta.etag)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ IGNORE_PROPS = (
|
||||||
|
|
||||||
|
|
||||||
class Item:
|
class Item:
|
||||||
|
|
||||||
"""Immutable wrapper class for VCALENDAR (VEVENT, VTODO) and
|
"""Immutable wrapper class for VCALENDAR (VEVENT, VTODO) and
|
||||||
VCARD"""
|
VCARD"""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue