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
@@ -15,6 +15,7 @@ import pymupdf
|
||||
from pdf2image import convert_from_path
|
||||
from PIL import Image, ImageTk
|
||||
|
||||
from copienator import configuration
|
||||
from copienator import (
|
||||
CliError,
|
||||
EvaluationWorkspace,
|
||||
@@ -27,7 +28,6 @@ from copienator import (
|
||||
)
|
||||
from copienator.filesystem import staged_files
|
||||
from copienator.copy_errors import clear_copy_error, mark_copy_error, marked_copy_paths
|
||||
from copienator.configuration import SHOW_PERSONAL_STEPS
|
||||
from copienator.left_margin import analyse_margins
|
||||
from copienator.name_grids import name_bottom_height_fraction
|
||||
from copienator.annotation_layout import fingerprint
|
||||
@@ -42,8 +42,8 @@ NARROW_PAGE_RATIO = 0.8
|
||||
AUTO_STRIP_WIDTH_FACTOR = 1.10
|
||||
pdf_cache_lock = threading.Lock()
|
||||
|
||||
# The requested spelling is kept as the public switch for this alternate layout.
|
||||
personnal_binding = bool(SHOW_PERSONAL_STEPS)
|
||||
def personal_bindings_enabled() -> bool:
|
||||
return bool(configuration.SHOW_PERSONAL_STEPS)
|
||||
|
||||
|
||||
def distribute_pages(total_pages: int, max_per_file: int = 5) -> list[int]:
|
||||
@@ -316,7 +316,7 @@ class ImageReviewer:
|
||||
self.root.bind("<Right>", lambda _event: self.on_shift(CROP_SHIFT_STEP))
|
||||
self.root.bind("<Up>", lambda _event: self.on_enlarge(CROP_WIDTH_STEP))
|
||||
self.root.bind("<Down>", lambda _event: self.on_enlarge(-CROP_WIDTH_STEP))
|
||||
if personnal_binding:
|
||||
if personal_bindings_enabled():
|
||||
self.root.bind("t", lambda _event: self.on_shift(-CROP_SHIFT_STEP))
|
||||
self.root.bind("n", lambda _event: self.on_shift(CROP_SHIFT_STEP))
|
||||
self.root.bind("r", lambda _event: self.on_enlarge(CROP_WIDTH_STEP))
|
||||
@@ -416,7 +416,7 @@ class ImageReviewer:
|
||||
self.label_img.image = tk_image
|
||||
personal_instructions = (
|
||||
"\nt/s/r/n also available: left / narrower / wider / right"
|
||||
if personnal_binding
|
||||
if personal_bindings_enabled()
|
||||
else ""
|
||||
)
|
||||
analysis = schema.get('auto_margin')
|
||||
|
||||
Reference in new issue
Block a user