From ea99ef071a0077dd2fa902b0e8d79936a839cc84 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 29 Aug 2023 10:04:06 +0200 Subject: [PATCH] Format black --- papis_extract/extractor.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/papis_extract/extractor.py b/papis_extract/extractor.py index 9467231..88ff012 100644 --- a/papis_extract/extractor.py +++ b/papis_extract/extractor.py @@ -42,7 +42,7 @@ def start(filename: Path) -> list[Annotation]: def _tag_from_colorname(colorname: str) -> str: - color_mapping: dict[str,str] = getdict("tags", "plugins.extract") + color_mapping: dict[str, str] = getdict("tags", "plugins.extract") if not color_mapping: return "" @@ -82,6 +82,7 @@ def _retrieve_annotation_content( # just a highlight without any text return (None, None) + # mimics the functions in papis.config.{getlist,getint,getfloat} etc. def getdict(key: str, section: Optional[str] = None) -> dict[str, str]: """Dict getter @@ -97,13 +98,14 @@ def getdict(key: str, section: Optional[str] = None) -> dict[str, str]: rawvalue = eval(rawvalue) except Exception: raise SyntaxError( - "The key '{}' must be a valid Python object: {}" - .format(key, rawvalue)) + "The key '{}' must be a valid Python object: {}".format(key, rawvalue) + ) else: if not isinstance(rawvalue, dict): raise SyntaxError( - "The key '{}' must be a valid Python dict. Got: {} (type {!r})" - .format(key, rawvalue, type(rawvalue).__name__)) + "The key '{}' must be a valid Python dict. Got: {} (type {!r})".format( + key, rawvalue, type(rawvalue).__name__ + ) + ) return rawvalue -