Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added hyphen to list of invalid id chars #24

Merged
merged 1 commit into from
Oct 23, 2024
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
6 changes: 3 additions & 3 deletions xnat_ingest/cli/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
are uploaded to XNAT
""",
)
@click.argument("files_path", type=str, envvar="XINGEST_DICOMS_PATH")
@click.argument("output_dir", type=click.Path(path_type=Path), envvar="XINGEST_DIR")
@click.argument("files_path", type=str)
@click.argument("output_dir", type=click.Path(path_type=Path))
@click.option(
"--datatype",
type=str,
Expand Down Expand Up @@ -193,7 +193,7 @@
default=None,
metavar="<host> <user> <password>",
help="The XNAT server to upload to plus the user and password to use",
envvar="XNAT_INGEST_TRANSFER_XNAT_LOGIN",
envvar="XINGEST_XNAT_LOGIN",
)
@click.option(
"--spaces-to-underscores/--no-spaces-to-underscores",
Expand Down
11 changes: 7 additions & 4 deletions xnat_ingest/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ def test_stage_and_upload(
str(associated_files_dir)
+ "/{PatientName.family_name}_{PatientName.given_name}*.ptd",
r".*/[^\.]+.[^\.]+.[^\.]+.(?P<id>\d+)\.[A-Z]+_(?P<resource>[^\.]+).*",
"--logger",
"file",
"info",
str(log_file),
# "--logger",
# "file",
# "info",
# str(log_file),
"--additional-logger",
"xnat",
"--raise-errors",
Expand All @@ -213,6 +213,9 @@ def test_stage_and_upload(
"admin",
"admin",
],
env={
"XINGEST_LOGGERS": "file,info,/tmp/logging.log;stream,debug,stdout",
},
)

assert result.exit_code == 0, show_cli_trace(result)
Expand Down
2 changes: 1 addition & 1 deletion xnat_ingest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,4 @@ def glob_to_re(glob_pattern: str) -> str:

_str_templ_replacement = re.compile(r"\{[\w\.]+\}")

invalid_path_chars_re = re.compile(r'[<>:"/\\|?*\x00-\x1F]')
invalid_path_chars_re = re.compile(r'[\-<>:"/\\|?*\x00-\x1F]')
Loading