Mercurial > hg > orthanc-stone
annotate Resources/SyncOrthancFolder.py @ 70:f73aed014bde wasm
OrthancAsynchronousWebService
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 22 May 2017 21:43:49 +0200 |
parents | d20e25cfcf3a |
children |
rev | line source |
---|---|
0 | 1 #!/usr/bin/python |
2 | |
3 # | |
4 # This maintenance script updates the content of the "Orthanc" folder | |
5 # to match the latest version of the Orthanc source code. | |
6 # | |
7 | |
8 import sys | |
9 import multiprocessing | |
10 import os | |
11 import stat | |
12 import urllib2 | |
13 | |
16 | 14 TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc') |
0 | 15 REPOSITORY = 'https://bitbucket.org/sjodogne/orthanc/raw' |
16 | |
17 FILES = [ | |
18 'Core/ChunkedBuffer.cpp', | |
19 'Core/ChunkedBuffer.h', | |
20 'Core/Compression/DeflateBaseCompressor.cpp', | |
21 'Core/Compression/DeflateBaseCompressor.h', | |
22 'Core/Compression/GzipCompressor.cpp', | |
23 'Core/Compression/GzipCompressor.h', | |
24 'Core/Compression/IBufferCompressor.h', | |
25 'Core/Enumerations.cpp', | |
26 'Core/Enumerations.h', | |
27 'Core/HttpClient.cpp', | |
28 'Core/HttpClient.h', | |
57 | 29 'Core/IDynamicObject.h', |
0 | 30 'Core/Images/Image.cpp', |
31 'Core/Images/Image.h', | |
32 'Core/Images/ImageAccessor.cpp', | |
33 'Core/Images/ImageAccessor.h', | |
34 'Core/Images/ImageBuffer.cpp', | |
35 'Core/Images/ImageBuffer.h', | |
36 'Core/Images/ImageProcessing.cpp', | |
37 'Core/Images/ImageProcessing.h', | |
38 'Core/Images/JpegErrorManager.cpp', | |
39 'Core/Images/JpegErrorManager.h', | |
40 'Core/Images/JpegReader.cpp', | |
41 'Core/Images/JpegReader.h', | |
42 'Core/Images/PngReader.cpp', | |
43 'Core/Images/PngReader.h', | |
44 'Core/Logging.cpp', | |
45 'Core/Logging.h', | |
70
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
46 'Core/MultiThreading/SharedMessageQueue.cpp', |
f73aed014bde
OrthancAsynchronousWebService
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
57
diff
changeset
|
47 'Core/MultiThreading/SharedMessageQueue.h', |
0 | 48 'Core/OrthancException.h', |
49 'Core/PrecompiledHeaders.h', | |
15 | 50 'Core/SystemToolbox.cpp', |
51 'Core/SystemToolbox.h', | |
0 | 52 'Core/Toolbox.cpp', |
53 'Core/Toolbox.h', | |
54 'Core/WebServiceParameters.cpp', | |
55 'Core/WebServiceParameters.h', | |
31
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
56 'Plugins/Samples/Common/DicomDatasetReader.cpp', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
57 'Plugins/Samples/Common/DicomDatasetReader.h', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
58 'Plugins/Samples/Common/DicomPath.cpp', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
59 'Plugins/Samples/Common/DicomPath.h', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
60 'Plugins/Samples/Common/DicomTag.cpp', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
61 'Plugins/Samples/Common/DicomTag.h', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
62 'Plugins/Samples/Common/FullOrthancDataset.cpp', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
63 'Plugins/Samples/Common/FullOrthancDataset.h', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
64 'Plugins/Samples/Common/IDicomDataset.h', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
65 'Plugins/Samples/Common/IOrthancConnection.cpp', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
66 'Plugins/Samples/Common/IOrthancConnection.h', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
67 'Plugins/Samples/Common/OrthancHttpConnection.cpp', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
68 'Plugins/Samples/Common/OrthancHttpConnection.h', |
9aace933cb64
sharing code with the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
23
diff
changeset
|
69 'Plugins/Samples/Common/OrthancPluginException.h', |
0 | 70 'Resources/CMake/AutoGeneratedCode.cmake', |
71 'Resources/CMake/BoostConfiguration.cmake', | |
72 'Resources/CMake/Compiler.cmake', | |
73 'Resources/CMake/DownloadPackage.cmake', | |
20
946377d1c992
skeleton for unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
16
diff
changeset
|
74 'Resources/CMake/GoogleTestConfiguration.cmake', |
0 | 75 'Resources/CMake/JsonCppConfiguration.cmake', |
76 'Resources/CMake/LibCurlConfiguration.cmake', | |
77 'Resources/CMake/LibIconvConfiguration.cmake', | |
78 'Resources/CMake/LibJpegConfiguration.cmake', | |
79 'Resources/CMake/LibPngConfiguration.cmake', | |
80 'Resources/CMake/OpenSslConfiguration.cmake', | |
81 'Resources/CMake/ZlibConfiguration.cmake', | |
82 'Resources/EmbedResources.py', | |
83 'Resources/MinGW-W64-Toolchain32.cmake', | |
84 'Resources/MinGW-W64-Toolchain64.cmake', | |
85 'Resources/MinGWToolchain.cmake', | |
86 'Resources/ThirdParty/VisualStudio/stdint.h', | |
87 'Resources/ThirdParty/base64/base64.cpp', | |
88 'Resources/ThirdParty/base64/base64.h', | |
89 'Resources/ThirdParty/patch/msys-1.0.dll', | |
90 'Resources/ThirdParty/patch/patch.exe', | |
91 'Resources/ThirdParty/patch/patch.exe.manifest', | |
92 'Resources/WindowsResources.py', | |
93 'Resources/WindowsResources.rc', | |
94 ] | |
95 | |
96 EXE = [ | |
97 'Resources/WindowsResources.py', | |
98 ] | |
99 | |
100 | |
101 def Download(x): | |
102 branch = x[0] | |
103 source = x[1] | |
104 target = os.path.join(TARGET, x[2]) | |
105 print target | |
106 | |
107 try: | |
108 os.makedirs(os.path.dirname(target)) | |
109 except: | |
110 pass | |
111 | |
23 | 112 url = '%s/%s/%s' % (REPOSITORY, branch, source) |
0 | 113 |
114 with open(target, 'w') as f: | |
115 f.write(urllib2.urlopen(url).read()) | |
116 | |
117 | |
118 commands = [] | |
119 | |
120 for f in FILES: | |
121 commands.append([ 'default', f, f ]) | |
122 | |
123 | |
124 if sys.platform == 'win32': | |
125 # Sequential execution | |
126 for c in commands: | |
127 Download(c) | |
128 else: | |
129 # Concurrent downloads | |
130 pool = multiprocessing.Pool(10) | |
131 pool.map(Download, commands) | |
132 | |
133 | |
134 for exe in EXE: | |
135 path = os.path.join(TARGET, exe) | |
136 st = os.stat(path) | |
137 os.chmod(path, st.st_mode | stat.S_IEXEC) | |
138 |