chore: format with black

This commit is contained in:
dogeystamp 2024-03-22 20:33:03 -04:00
parent 585ba739d1
commit 8f4449ca64
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 9 additions and 2 deletions

View File

@ -86,6 +86,7 @@ class FitzBookmark:
title: SectionTitle
page: PageNumber
class FitzDestinations(TypedDict):
page: PageNumber
to: tuple[int, int]

View File

@ -25,9 +25,15 @@ def get_destination_pdf() -> PDFDestination:
page_ref: PDFPage = get_page_pdf()
with fitz.Document(page_ref.filepath) as doc:
destinations = cast(FitzDestinations, cast(Any, doc).resolve_names())
page_dests = {k: x for k, x in destinations.items() if cast(Any, x)["page"]+1 == page_ref.page}
page_dests = {
k: x
for k, x in destinations.items()
if cast(Any, x)["page"] + 1 == page_ref.page
}
rofi_res = rofi([f"{k}" for k, _ in page_dests.items()], prompt="Select named destination: ")
rofi_res = rofi(
[f"{k}" for k, _ in page_dests.items()], prompt="Select named destination: "
)
if rofi_res is None or rofi_res.index is None:
raise RuntimeError("No destination was selected.")
else: