chore: Black formatting
This commit is contained in:
parent
c2aec7add6
commit
19599a66d7
6 changed files with 12 additions and 10 deletions
|
@ -24,5 +24,4 @@ class Exporter(Protocol):
|
|||
|
||||
def run(
|
||||
self, annot_docs: list[tuple[papis.document.Document, list[Annotation]]]
|
||||
) -> None:
|
||||
...
|
||||
) -> None: ...
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import papis.logging
|
||||
|
||||
from papis_extract.exporter import Exporter
|
||||
|
|
|
@ -29,7 +29,9 @@ class NotesExporter:
|
|||
"""
|
||||
for doc, annots in annot_docs:
|
||||
# first always true since we write single doc per note
|
||||
formatted_annotations: list[str] = self.formatter(doc, annots, first=True).split("\n")
|
||||
formatted_annotations: list[str] = self.formatter(
|
||||
doc, annots, first=True
|
||||
).split("\n")
|
||||
if formatted_annotations:
|
||||
self._add_annots_to_note(doc, formatted_annotations, force=self.force)
|
||||
|
||||
|
|
|
@ -14,11 +14,9 @@ logger = papis.logging.get_logger(__name__)
|
|||
|
||||
|
||||
class Extractor(Protocol):
|
||||
def can_process(self, filename: Path) -> bool:
|
||||
...
|
||||
def can_process(self, filename: Path) -> bool: ...
|
||||
|
||||
def run(self, filename: Path) -> list[Annotation]:
|
||||
...
|
||||
def run(self, filename: Path) -> list[Annotation]: ...
|
||||
|
||||
|
||||
def start(
|
||||
|
|
|
@ -3,6 +3,7 @@ from papis.document import Document
|
|||
|
||||
from papis_extract.annotation import Annotation
|
||||
|
||||
|
||||
class Formatter(Protocol):
|
||||
"""Basic formatter protocol.
|
||||
|
||||
|
@ -16,8 +17,10 @@ class Formatter(Protocol):
|
|||
exporter is used, if multiple entries are printed.
|
||||
This can be useful for adding a header if necessary for the format.
|
||||
"""
|
||||
def __call__(self, document: Document, annotations: list[Annotation], first: bool) -> str:
|
||||
...
|
||||
|
||||
def __call__(
|
||||
self, document: Document, annotations: list[Annotation], first: bool
|
||||
) -> str: ...
|
||||
|
||||
|
||||
def format_markdown(
|
||||
|
|
|
@ -60,6 +60,7 @@ def test_csv_default():
|
|||
'"document-title","","myfile.pdf"'
|
||||
)
|
||||
|
||||
|
||||
def test_csv_with_header():
|
||||
fmt = format_csv
|
||||
assert fmt(document, annotations, first=True) == (
|
||||
|
|
Loading…
Reference in a new issue