comparison Resources/SyncOrthancFolder.py @ 145:8b310d571e5b

sync orthanc folder
author Alain Mazy <am@osimis.io>
date Mon, 13 Nov 2023 21:12:54 +0100
parents cc0765aae484
children c012edac593e
comparison
equal deleted inserted replaced
144:93c6f12bf339 145:8b310d571e5b
7 7
8 import multiprocessing 8 import multiprocessing
9 import os 9 import os
10 import stat 10 import stat
11 import urllib.request 11 import urllib.request
12 import subprocess
13 12
14 TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc') 13 TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc')
15 PLUGIN_SDK_VERSION = '1.10.0' 14 PLUGIN_SDK_VERSION = '1.10.0'
16 REPOSITORY = 'https://hg.orthanc-server.com/orthanc/raw-file' 15 REPOSITORY = 'https://orthanc.uclouvain.be/hg/orthanc/raw-file'
17 16
18 FILES = [ 17 FILES = [
19 ('OrthancFramework/Resources/CMake/AutoGeneratedCode.cmake', 'CMake'), 18 ('OrthancFramework/Resources/CMake/AutoGeneratedCode.cmake', 'CMake'),
20 ('OrthancFramework/Resources/CMake/Compiler.cmake', 'CMake'), 19 ('OrthancFramework/Resources/CMake/Compiler.cmake', 'CMake'),
21 ('OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake', 'CMake'), 20 ('OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake', 'CMake'),
22 ('OrthancFramework/Resources/CMake/DownloadPackage.cmake', 'CMake'), 21 ('OrthancFramework/Resources/CMake/DownloadPackage.cmake', 'CMake'),
23 22 ('OrthancFramework/Resources/CMake/GoogleTestConfiguration.cmake', 'CMake'),
23 ('OrthancFramework/Resources/EmbedResources.py', 'CMake'),
24 ('OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake', 'Toolchains'), 24 ('OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake', 'Toolchains'),
25 ('OrthancFramework/Resources/Toolchains/MinGW-W64-Toolchain32.cmake', 'Toolchains'), 25 ('OrthancFramework/Resources/Toolchains/MinGW-W64-Toolchain32.cmake', 'Toolchains'),
26 ('OrthancFramework/Resources/Toolchains/MinGW-W64-Toolchain64.cmake', 'Toolchains'), 26 ('OrthancFramework/Resources/Toolchains/MinGW-W64-Toolchain64.cmake', 'Toolchains'),
27 ('OrthancFramework/Resources/Toolchains/MinGWToolchain.cmake', 'Toolchains'), 27 ('OrthancFramework/Resources/Toolchains/MinGWToolchain.cmake', 'Toolchains'),
28
29 ('OrthancServer/Plugins/Samples/Common/ExportedSymbolsPlugins.list', 'Plugins'), 28 ('OrthancServer/Plugins/Samples/Common/ExportedSymbolsPlugins.list', 'Plugins'),
30 ('OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp', 'Plugins'), 29 ('OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp', 'Plugins'),
31 ('OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h', 'Plugins'), 30 ('OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h', 'Plugins'),
32 ('OrthancServer/Plugins/Samples/Common/OrthancPluginException.h', 'Plugins'), 31 ('OrthancServer/Plugins/Samples/Common/OrthancPluginException.h', 'Plugins'),
33 ('OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake', 'Plugins'), 32 ('OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake', 'Plugins'),
75 ]) 74 ])
76 75
77 76
78 pool = multiprocessing.Pool(10) # simultaneous downloads 77 pool = multiprocessing.Pool(10) # simultaneous downloads
79 pool.map(Download, commands) 78 pool.map(Download, commands)
80
81
82 # Patch the SDK, if need be
83 patch = os.path.join(os.path.abspath(os.path.dirname(__file__)),
84 'OrthancCPlugin-%s.patch' % PLUGIN_SDK_VERSION)
85 if os.path.exists(patch):
86 subprocess.check_call([ 'patch', '-p0', '-i', patch ],
87 cwd = os.path.join(os.path.dirname(__file__),
88 'Orthanc',
89 'Sdk-%s' % PLUGIN_SDK_VERSION, 'orthanc'))