comparison Resources/SyncOrthancFolder.py @ 175:c012edac593e java-code-model

patching the Orthanc SDK
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Jun 2024 18:10:31 +0200
parents 8b310d571e5b
children d08d75fc6d6a
comparison
equal deleted inserted replaced
174:e9be3c9294d4 175:c012edac593e
6 # 6 #
7 7
8 import multiprocessing 8 import multiprocessing
9 import os 9 import os
10 import stat 10 import stat
11 import subprocess
11 import urllib.request 12 import urllib.request
12 13
13 TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc') 14 TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc')
14 PLUGIN_SDK_VERSION = '1.10.0' 15 PLUGIN_SDK_VERSION = '1.10.0'
15 REPOSITORY = 'https://orthanc.uclouvain.be/hg/orthanc/raw-file' 16 REPOSITORY = 'https://orthanc.uclouvain.be/hg/orthanc/raw-file'
74 ]) 75 ])
75 76
76 77
77 pool = multiprocessing.Pool(10) # simultaneous downloads 78 pool = multiprocessing.Pool(10) # simultaneous downloads
78 pool.map(Download, commands) 79 pool.map(Download, commands)
80
81 # Patch the SDK, if need be
82 patch = os.path.join(os.path.abspath(os.path.dirname(__file__)),
83 'OrthancCPlugin-%s.patch' % PLUGIN_SDK_VERSION)
84 if os.path.exists(patch):
85 subprocess.check_call([ 'patch', '-p0', '-i', patch ],
86 cwd = os.path.join(os.path.dirname(__file__),
87 'Orthanc',
88 'Sdk-%s' % PLUGIN_SDK_VERSION, 'orthanc'))