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