# HG changeset patch # User Alain Mazy # Date 1707465856 -3600 # Node ID 509c741f6ac0aa3b5abe1b3021063f1b035a99b3 # Parent 2bce8d26db5e6ec0fe50bf49839a41089997b9d4# Parent f88aaf269fda4be8d86c5ea9b58adfd70bf9e938 merge diff -r f88aaf269fda -r 509c741f6ac0 OrthancServer/Resources/Samples/Python/ArchiveStudiesInTimeRange.py --- a/OrthancServer/Resources/Samples/Python/ArchiveStudiesInTimeRange.py Thu Feb 08 17:42:33 2024 +0100 +++ b/OrthancServer/Resources/Samples/Python/ArchiveStudiesInTimeRange.py Fri Feb 09 09:04:16 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)