mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
439f1e6f50
commit
246568f149
1 changed files with 6 additions and 16 deletions
|
|
@ -107,10 +107,7 @@ class _ConfigReader:
|
|||
self._storages: dict[str, dict[str, str]] = {}
|
||||
|
||||
def _parse_section(
|
||||
self,
|
||||
section_type: str,
|
||||
name: str,
|
||||
options: dict[str, Any]
|
||||
self, section_type: str, name: str, options: dict[str, Any]
|
||||
) -> None:
|
||||
validate_section_name(name, section_type)
|
||||
if name in self._seen_names:
|
||||
|
|
@ -129,7 +126,7 @@ class _ConfigReader:
|
|||
raise ValueError("Unknown section type.")
|
||||
|
||||
def parse(
|
||||
self
|
||||
self,
|
||||
) -> tuple[dict[str, str], dict[str, dict[str, str]], dict[str, dict[str, str]]]:
|
||||
for section in self._parser.sections():
|
||||
if " " in section:
|
||||
|
|
@ -157,8 +154,7 @@ class _ConfigReader:
|
|||
|
||||
|
||||
def _parse_options(
|
||||
items: list[tuple[str, str]],
|
||||
section: str | None = None
|
||||
items: list[tuple[str, str]], section: str | None = None
|
||||
) -> Generator[tuple[str, dict[str, str]], None, None]:
|
||||
for key, value in items:
|
||||
try:
|
||||
|
|
@ -172,7 +168,7 @@ class Config:
|
|||
self,
|
||||
general: dict[str, str],
|
||||
pairs: dict[str, dict[str, str]],
|
||||
storages: dict[str, dict[str, str]]
|
||||
storages: dict[str, dict[str, str]],
|
||||
) -> None:
|
||||
self.general = general
|
||||
self.storages = storages
|
||||
|
|
@ -258,8 +254,7 @@ class PairConfig:
|
|||
raise ValueError("Unknown options: {}".format(", ".join(options)))
|
||||
|
||||
def _process_conflict_resolution_param(
|
||||
self,
|
||||
conflict_resolution: str | list[str] | None
|
||||
self, conflict_resolution: str | list[str] | None
|
||||
):
|
||||
if conflict_resolution in (None, "a wins", "b wins"):
|
||||
return conflict_resolution
|
||||
|
|
@ -337,12 +332,7 @@ load_config = Config.from_filename_or_environment
|
|||
|
||||
|
||||
def _resolve_conflict_via_command(
|
||||
a,
|
||||
b,
|
||||
command,
|
||||
a_name,
|
||||
b_name,
|
||||
_check_call=None
|
||||
a, b, command, a_name, b_name, _check_call=None
|
||||
) -> Item:
|
||||
import shutil
|
||||
import tempfile
|
||||
|
|
|
|||
Loading…
Reference in a new issue