Support evaluation-local configuration and names overrides
This commit is contained in:
1 parent
0bb6f7d97c
commit
d4404e4c27
36 files changed
+409
-184
No files matched your search
@@ -16,7 +16,7 @@ import pymupdf # PyMuPDF
|
||||
from PIL import Image, ImageDraw, ImageTk
|
||||
from pypdf import PdfReader, PdfWriter
|
||||
|
||||
from copienator.configuration import PAGE_SPLITTER_KB
|
||||
from copienator import configuration
|
||||
from copienator import (
|
||||
CliError,
|
||||
EvaluationWorkspace,
|
||||
@@ -29,14 +29,6 @@ from copienator.platform import launch_pdf_arranger
|
||||
from copienator.copy_errors import marked_copy_paths, clear_copy_error
|
||||
from copienator.orientation import save_provenance, report_path
|
||||
|
||||
# Keep new shortcuts available with older personal configuration files.
|
||||
PAGE_SPLITTER_KB = {
|
||||
"reverse_pages": "i",
|
||||
"add_secondary_splitter": "<Insert>",
|
||||
"delete_secondary_splitter": "<Delete>",
|
||||
**PAGE_SPLITTER_KB,
|
||||
}
|
||||
|
||||
# --- Constants ---
|
||||
# Conversion factor: 1 cm to points (1 inch = 2.54 cm, 72 points = 1 inch)
|
||||
CM_TO_POINTS = (1 / 2.54) * 72
|
||||
@@ -172,7 +164,7 @@ class PDFPreviewer:
|
||||
self.master.geometry("800x1000")
|
||||
|
||||
def fmt(action):
|
||||
k = PAGE_SPLITTER_KB.get(action, "")
|
||||
k = configuration.PAGE_SPLITTER_KB.get(action, "")
|
||||
return k
|
||||
|
||||
# Dynamic instructions text
|
||||
@@ -216,7 +208,7 @@ class PDFPreviewer:
|
||||
"prev_file": self.go_to_previous_file,
|
||||
}
|
||||
|
||||
for action, key in PAGE_SPLITTER_KB.items():
|
||||
for action, key in configuration.PAGE_SPLITTER_KB.items():
|
||||
if action in action_map:
|
||||
self.master.bind(key, action_map[action])
|
||||
|
||||
|
||||
Reference in new issue
Block a user