chore: Log found files for extractors to debug logger
This commit is contained in:
parent
729b6aa62a
commit
b2ce6023a2
3 changed files with 14 additions and 7 deletions
|
|
@ -25,7 +25,12 @@ class PdfExtractor:
|
||||||
if not filename.is_file():
|
if not filename.is_file():
|
||||||
logger.error(f"File {str(filename)} not readable.")
|
logger.error(f"File {str(filename)} not readable.")
|
||||||
return False
|
return False
|
||||||
return self._is_pdf(filename)
|
|
||||||
|
if not self._is_pdf(filename):
|
||||||
|
return False
|
||||||
|
|
||||||
|
logger.debug(f"Found processable annotation file: {filename}")
|
||||||
|
return True
|
||||||
|
|
||||||
def run(self, filename: Path) -> list[Annotation]:
|
def run(self, filename: Path) -> list[Annotation]:
|
||||||
"""Extract annotations from a file.
|
"""Extract annotations from a file.
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,13 @@ class PocketBookExtractor:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
html = BeautifulSoup(content, features="xml")
|
html = BeautifulSoup(content, features="xml")
|
||||||
return bool(
|
if not html.find(
|
||||||
html.find(
|
"meta", {"name": "generator", "content": "PocketBook Bookmarks Export"}
|
||||||
"meta", {"name": "generator", "content": "PocketBook Bookmarks Export"}
|
):
|
||||||
)
|
return False
|
||||||
)
|
|
||||||
|
logger.debug(f"Found processable annotation file: {filename}")
|
||||||
|
return True
|
||||||
|
|
||||||
def run(self, filename: Path) -> list[Annotation]:
|
def run(self, filename: Path) -> list[Annotation]:
|
||||||
"""Extract annotations from pocketbook html file.
|
"""Extract annotations from pocketbook html file.
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class ReadEraExtractor:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"Found annotation file processable with ReadEraExtractor: {filename}"
|
f"Found processable annotation file: {filename}"
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue