(ctx: click.Context, input: str | None, start_col_name: str | None)
| 992 | ) |
| 993 | @click.pass_context |
| 994 | def load_scenes_command(ctx: click.Context, input: str | None, start_col_name: str | None): |
| 995 | ctx = ctx.obj |
| 996 | assert isinstance(ctx, CliContext) |
| 997 | |
| 998 | logger.debug("Will load scenes from %s (start_col_name = %s)", input, start_col_name) |
| 999 | assert ctx.scene_manager is not None |
| 1000 | if ctx.scene_manager.get_num_detectors() > 0: |
| 1001 | raise click.ClickException("The load-scenes command cannot be used with detectors.") |
| 1002 | if ctx.load_scenes_input: |
| 1003 | raise click.ClickException("The load-scenes command must only be specified once.") |
| 1004 | if input is None: |
| 1005 | raise click.BadParameter("Input file is required.", param_hint="-i/--input") |
| 1006 | input = os.path.abspath(input) |
| 1007 | if not os.path.exists(input): |
| 1008 | raise click.BadParameter( |
| 1009 | f"Could not load scenes, file does not exist: {input}", param_hint="-i/--input" |
| 1010 | ) |
| 1011 | ctx.load_scenes_input = input |
| 1012 | ctx.load_scenes_column_name = ctx.config.get_value( |
| 1013 | "load-scenes", "start-col-name", start_col_name |
| 1014 | ) |
| 1015 | |
| 1016 | |
| 1017 | SAVE_HTML_HELP = """Save scene list to HTML file. |
nothing calls this directly
no test coverage detected