mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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]] = {}
|
self._storages: dict[str, dict[str, str]] = {}
|
||||||
|
|
||||||
def _parse_section(
|
def _parse_section(
|
||||||
self,
|
self, section_type: str, name: str, options: dict[str, Any]
|
||||||
section_type: str,
|
|
||||||
name: str,
|
|
||||||
options: dict[str, Any]
|
|
||||||
) -> None:
|
) -> None:
|
||||||
validate_section_name(name, section_type)
|
validate_section_name(name, section_type)
|
||||||
if name in self._seen_names:
|
if name in self._seen_names:
|
||||||
|
|
@ -129,7 +126,7 @@ class _ConfigReader:
|
||||||
raise ValueError("Unknown section type.")
|
raise ValueError("Unknown section type.")
|
||||||
|
|
||||||
def parse(
|
def parse(
|
||||||
self
|
self,
|
||||||
) -> tuple[dict[str, str], dict[str, dict[str, str]], dict[str, dict[str, str]]]:
|
) -> tuple[dict[str, str], dict[str, dict[str, str]], dict[str, dict[str, str]]]:
|
||||||
for section in self._parser.sections():
|
for section in self._parser.sections():
|
||||||
if " " in section:
|
if " " in section:
|
||||||
|
|
@ -157,8 +154,7 @@ class _ConfigReader:
|
||||||
|
|
||||||
|
|
||||||
def _parse_options(
|
def _parse_options(
|
||||||
items: list[tuple[str, str]],
|
items: list[tuple[str, str]], section: str | None = None
|
||||||
section: str | None = None
|
|
||||||
) -> Generator[tuple[str, dict[str, str]], None, None]:
|
) -> Generator[tuple[str, dict[str, str]], None, None]:
|
||||||
for key, value in items:
|
for key, value in items:
|
||||||
try:
|
try:
|
||||||
|
|
@ -172,7 +168,7 @@ class Config:
|
||||||
self,
|
self,
|
||||||
general: dict[str, str],
|
general: dict[str, str],
|
||||||
pairs: dict[str, dict[str, str]],
|
pairs: dict[str, dict[str, str]],
|
||||||
storages: dict[str, dict[str, str]]
|
storages: dict[str, dict[str, str]],
|
||||||
) -> None:
|
) -> None:
|
||||||
self.general = general
|
self.general = general
|
||||||
self.storages = storages
|
self.storages = storages
|
||||||
|
|
@ -258,8 +254,7 @@ class PairConfig:
|
||||||
raise ValueError("Unknown options: {}".format(", ".join(options)))
|
raise ValueError("Unknown options: {}".format(", ".join(options)))
|
||||||
|
|
||||||
def _process_conflict_resolution_param(
|
def _process_conflict_resolution_param(
|
||||||
self,
|
self, conflict_resolution: str | list[str] | None
|
||||||
conflict_resolution: str | list[str] | None
|
|
||||||
):
|
):
|
||||||
if conflict_resolution in (None, "a wins", "b wins"):
|
if conflict_resolution in (None, "a wins", "b wins"):
|
||||||
return conflict_resolution
|
return conflict_resolution
|
||||||
|
|
@ -337,12 +332,7 @@ load_config = Config.from_filename_or_environment
|
||||||
|
|
||||||
|
|
||||||
def _resolve_conflict_via_command(
|
def _resolve_conflict_via_command(
|
||||||
a,
|
a, b, command, a_name, b_name, _check_call=None
|
||||||
b,
|
|
||||||
command,
|
|
||||||
a_name,
|
|
||||||
b_name,
|
|
||||||
_check_call=None
|
|
||||||
) -> Item:
|
) -> Item:
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue