Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies = [
"pyzbar>=0.1.9",
"qrcode>=8.0",
"opencv-python>=4.9.0.80",
"filelock>=3.16.0",
]

[project.optional-dependencies]
Expand Down
23 changes: 15 additions & 8 deletions src/reprostim/cli/cmd_video_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,21 @@
"recording and produces a summary table "
"(videos.tsv) ."
)
@click.argument("path", type=click.Path(exists=True))
@click.argument(
"paths",
nargs=-1, # accept 1 or more arguments
type=click.Path(exists=True, dir_okay=True, file_okay=True),
)
@click.option(
"-m",
"--mode",
type=click.Choice(["full", "incremental", "force",
"rerun-for-na", "reset-to-na"],
case_sensitive=True),
default="incremental",
show_default=True,
help=(
"""Specifies operation mode, default is 'incremental' :.
"""Specifies operation mode:.

- [full] : regenerate everything from scratch,

Expand Down Expand Up @@ -109,7 +114,8 @@
)
@click.pass_context
def video_audit(
ctx, path: str, mode: str, output: str,
ctx, paths: tuple[str, ...],
mode: str, output: str,
recursive: bool, audit_src,
max_files: int, path_mask: str,
verbose: bool
Expand All @@ -120,7 +126,7 @@ def video_audit(

logger.debug("video_audit(...)")
logger.debug(f"Working dir : {os.getcwd()}")
logger.info(f"Video full path : {path}")
logger.info(f"Video full paths : {paths}")
logger.info(f"Output TSV file : {output}")
logger.info(f"Recursive scan : {recursive}")
logger.info(f"Operation mode : {mode}")
Expand All @@ -130,11 +136,12 @@ def video_audit(
logger.info(f"Path mask : {path_mask}")
logger.info(f"Verbose output : {verbose}")

if not os.path.exists(path):
logger.error(f"Path does not exist: {path}")
return 1
for path in paths:
if not os.path.exists(path):
logger.error(f"Path does not exist: {path}")
return 1

do_main(path, output, recursive, VaMode(mode),
do_main(list(paths), output, recursive, VaMode(mode),
{VaSource(s) for s in audit_src},
max_files, path_mask, verbose, click.echo)
return 0
Loading
Loading