Skip to content

Commit

Permalink
Merge pull request #24 from Australian-Imaging-Service/invalid-hyphens
Browse files Browse the repository at this point in the history
added hyphen to list of invalid id chars
  • Loading branch information
tclose authored Oct 23, 2024
2 parents 8f4877d + 746998c commit 58d261e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
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]')

0 comments on commit 58d261e

Please sign in to comment.