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
@@ -6,11 +6,10 @@ from pathlib import Path
|
||||
|
||||
import ezodf
|
||||
|
||||
from copienator.configuration import CURRENT_SCORE_ODS_PATH
|
||||
from copienator import configuration
|
||||
from copienator.utils import read_all_labels
|
||||
|
||||
# Configuration
|
||||
ODS_PATH = Path(CURRENT_SCORE_ODS_PATH).expanduser()
|
||||
TARGET_DIR_NAME = "A Rendre"
|
||||
|
||||
def main(argv=None):
|
||||
@@ -20,6 +19,8 @@ def main(argv=None):
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
work_dir = os.path.abspath(args.work_dir)
|
||||
configuration.use_evaluation(work_dir)
|
||||
ods_path = Path(configuration.CURRENT_SCORE_ODS_PATH).expanduser()
|
||||
|
||||
all_labels = read_all_labels(Path(work_dir))
|
||||
|
||||
@@ -29,13 +30,13 @@ def main(argv=None):
|
||||
print(f"Error: Directory '{TARGET_DIR_NAME}' not found in {work_dir}")
|
||||
sys.exit(1)
|
||||
|
||||
if not os.path.exists(ODS_PATH):
|
||||
print(f"Error: ODS file not found at {ODS_PATH}")
|
||||
if not os.path.exists(ods_path):
|
||||
print(f"Error: ODS file not found at {ods_path}")
|
||||
sys.exit(1)
|
||||
|
||||
print(f"Opening ODS file: {ODS_PATH}...")
|
||||
print(f"Opening ODS file: {ods_path}...")
|
||||
try:
|
||||
doc = ezodf.opendoc(str(ODS_PATH))
|
||||
doc = ezodf.opendoc(str(ods_path))
|
||||
except Exception as e:
|
||||
print(f"Failed to open ODS: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
Reference in new issue
Block a user