chore: Format files with ruff
This commit is contained in:
parent
a854ef00d6
commit
96cd4929c9
8 changed files with 29 additions and 41 deletions
|
|
@ -3,9 +3,8 @@ from importlib.util import find_spec
|
|||
import papis.logging
|
||||
|
||||
from papis_extract.extraction import Extractor
|
||||
from papis_extract.extractors import pdf
|
||||
from papis_extract.extractors import pdf, readera
|
||||
from papis_extract.extractors.pocketbook import PocketBookExtractor
|
||||
from papis_extract.extractors import readera
|
||||
|
||||
logger = papis.logging.get_logger(__name__)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ class PdfExtractor:
|
|||
annotations: list[Annotation] = []
|
||||
try:
|
||||
with mu.Document(filename) as doc:
|
||||
for (
|
||||
page
|
||||
) in doc: # pyright: ignore [reportUnknownVariableType] - missing stub
|
||||
for page in doc: # pyright: ignore [reportUnknownVariableType] - missing stub
|
||||
annot: mu.Annot
|
||||
for annot in page.annots():
|
||||
quote, note = self._retrieve_annotation_content(page, annot)
|
||||
|
|
|
|||
|
|
@ -44,16 +44,13 @@ class PocketBookExtractor:
|
|||
annotations: list[Annotation] = []
|
||||
for bm in html.select("div.bookmark"):
|
||||
content = str(
|
||||
(bm.select_one("div.bm-text>p") or html.new_string("")).text
|
||||
or "" # pyright: ignore [reportUnknownArgumentType]
|
||||
(bm.select_one("div.bm-text>p") or html.new_string("")).text or "" # pyright: ignore [reportUnknownArgumentType]
|
||||
)
|
||||
note = str(
|
||||
(bm.select_one("div.bm-note>p") or html.new_string("")).text
|
||||
or "" # pyright: ignore [reportUnknownArgumentType]
|
||||
(bm.select_one("div.bm-note>p") or html.new_string("")).text or "" # pyright: ignore [reportUnknownArgumentType]
|
||||
)
|
||||
page = int(
|
||||
(bm.select_one("p.bm-page") or html.new_string("")).text
|
||||
or 0 # pyright: ignore [reportUnknownArgumentType]
|
||||
(bm.select_one("p.bm-page") or html.new_string("")).text or 0 # pyright: ignore [reportUnknownArgumentType]
|
||||
)
|
||||
|
||||
el_classes = bm.attrs.get("class", "").split(" ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue