Windows compatibility
This commit is contained in:
@@ -30,6 +30,7 @@ class CommandVariant:
|
||||
program: str | None
|
||||
kind: str = "python" # python, shell, external, manual
|
||||
fixed_args: tuple[str, ...] = ()
|
||||
fixed_args_before_positionals: bool = False
|
||||
dangerous: bool = False
|
||||
|
||||
|
||||
@@ -116,7 +117,16 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
"Prétraitement des copies",
|
||||
"Retourner toutes les copies",
|
||||
"Rotation facultative de 180° lorsque les scans sont à l’envers.",
|
||||
(CommandVariant("rotate", "Rotation", "rotate_all.sh", "shell"),),
|
||||
(
|
||||
CommandVariant(
|
||||
"rotate",
|
||||
"Rotation",
|
||||
"copies_tools.py",
|
||||
"python",
|
||||
("rotate",),
|
||||
fixed_args_before_positionals=True,
|
||||
),
|
||||
),
|
||||
arguments=(arg_target("Dossier de l’évaluation"),),
|
||||
optional=True,
|
||||
),
|
||||
@@ -125,7 +135,16 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
"Prétraitement des copies",
|
||||
"Renommer les PDF en CopieXX.pdf",
|
||||
"Renomme les PDF du dossier d’évaluation dans leur ordre courant.",
|
||||
(CommandVariant("rename", "Renommage", "rename_to_copie.sh", "shell"),),
|
||||
(
|
||||
CommandVariant(
|
||||
"rename",
|
||||
"Renommage",
|
||||
"copies_tools.py",
|
||||
"python",
|
||||
("rename",),
|
||||
fixed_args_before_positionals=True,
|
||||
),
|
||||
),
|
||||
arguments=(arg_target("Dossier de l’évaluation"),),
|
||||
),
|
||||
StepDefinition(
|
||||
@@ -464,8 +483,11 @@ def build_command(
|
||||
elif spec.flag:
|
||||
options.extend((spec.flag, rendered))
|
||||
|
||||
if variant.fixed_args_before_positionals:
|
||||
command.extend(variant.fixed_args)
|
||||
command.extend(positionals)
|
||||
command.extend(variant.fixed_args)
|
||||
if not variant.fixed_args_before_positionals:
|
||||
command.extend(variant.fixed_args)
|
||||
command.extend(options)
|
||||
if extra_arguments.strip():
|
||||
command.extend(shlex.split(extra_arguments, posix=os.name != "nt"))
|
||||
|
||||
Reference in New Issue
Block a user