# HG changeset patch # User Sebastien Jodogne # Date 1486047394 -3600 # Node ID 71bca28a4645846c97314898b069726d65213d7d # Parent 2af6c0fb850d7591e7c6d0668093c6bc3e3bd23f remove the dependency upon installing Orthanc to generate the default configuration file diff -r 2af6c0fb850d -r 71bca28a4645 GenerateConfigurationForTests.py --- a/GenerateConfigurationForTests.py Wed Jan 04 16:40:03 2017 +0100 +++ b/GenerateConfigurationForTests.py Thu Feb 02 15:56:34 2017 +0100 @@ -26,6 +26,8 @@ import subprocess import sys import json +import urllib + ## ## Parse the command-line arguments @@ -76,7 +78,16 @@ # Retrieve the IP address of the localhost ip = socket.gethostbyname(socket.gethostname()) -subprocess.check_call([ 'Orthanc', '--config=%s' % args.target ]) + +# Download the content of the default configuration file +with open(args.target, 'w') as f: + url = 'https://bitbucket.org/sjodogne/orthanc/raw/Orthanc-1.2.0/Resources/Configuration.json' + http = urllib.urlopen(url) + if http.getcode() != 200: + raise Exception('Cannot download: %s' % url) + + f.write(http.read()) + with open(args.target, 'r') as f: # Remove the C++-style comments