# HG changeset patch # User Alain Mazy # Date 1707465826 -3600 # Node ID 2bce8d26db5e6ec0fe50bf49839a41089997b9d4 # Parent acdb8d78bf99783496ee908a0634bf5dbadeee0c added login/pwd to ArchiveStudiesInTimeRange.py diff -r acdb8d78bf99 -r 2bce8d26db5e OrthancServer/Resources/Samples/Python/ArchiveStudiesInTimeRange.py --- a/OrthancServer/Resources/Samples/Python/ArchiveStudiesInTimeRange.py Tue Feb 06 15:32:54 2024 +0100 +++ b/OrthancServer/Resources/Samples/Python/ArchiveStudiesInTimeRange.py Fri Feb 09 09:03:46 2024 +0100 @@ -30,8 +30,8 @@ def PrintHelp(): print('Download ZIP archives for all the studies generated ' 'during a given time range (according to the StudyDate tag)\n') - print('Usage: %s \n' % sys.argv[0]) - print('Example: %s http://127.0.0.1:8042/ 20150101 20151231 /tmp/\n' % sys.argv[0]) + print('Usage: %s [login] [password]\n' % sys.argv[0]) + print('Example: %s http://127.0.0.1:8042/ 20150101 20151231 /tmp/ login password\n' % sys.argv[0]) exit(-1) def CheckIsDate(date): @@ -40,13 +40,15 @@ exit(-1) -if len(sys.argv) != 5: +if len(sys.argv) < 5: PrintHelp() URL = sys.argv[1] START = sys.argv[2] END = sys.argv[3] TARGET = sys.argv[4] +if len(sys.argv) >= 7: + RestToolbox.SetCredentials(sys.argv[5], sys.argv[6]) CheckIsDate(START) CheckIsDate(END)