changeset 5532:509c741f6ac0

merge
author Alain Mazy <am@osimis.io>
date Fri, 09 Feb 2024 09:04:16 +0100
parents 2bce8d26db5e (diff) f88aaf269fda (current diff)
children 72511fbd1605
files
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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 <URL> <StartDate> <EndDate> <TargetFolder>\n' % sys.argv[0])
-    print('Example: %s http://127.0.0.1:8042/ 20150101 20151231 /tmp/\n' % sys.argv[0])
+    print('Usage: %s <URL> <StartDate> <EndDate> <TargetFolder> [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)