annotate Sources/Autogenerated/sdk_GlobalFunctions.impl.h @ 145:8b310d571e5b

sync orthanc folder
author Alain Mazy <am@osimis.io>
date Mon, 13 Nov 2023 21:12:54 +0100
parents 6288b8132659
children 0705e324fcc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Python plugin for Orthanc
114
65ec5597ec70 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
3 * Copyright (C) 2020-2023 Osimis S.A., Belgium
65ec5597ec70 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
4 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU Affero General Public License
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * as published by the Free Software Foundation, either version 3 of
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * the License, or (at your option) any later version.
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful, but
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * Affero General Public License for more details.
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 *
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * You should have received a copy of the GNU Affero General Public License
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 **/
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 static PyObject* sdk_OrthancPluginCheckVersionAdvanced(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
23 PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersionAdvanced()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
142
6288b8132659 replaced "int" by "int32_t" in the SDK to prevent any ABI issue
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
25 long int arg0 = 0;
6288b8132659 replaced "int" by "int32_t" in the SDK to prevent any ABI issue
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
26 long int arg1 = 0;
6288b8132659 replaced "int" by "int32_t" in the SDK to prevent any ABI issue
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
27 long int arg2 = 0;
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
142
6288b8132659 replaced "int" by "int32_t" in the SDK to prevent any ABI issue
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 114
diff changeset
29 if (!PyArg_ParseTuple(args, "lll", &arg0, &arg1, &arg2))
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 long value = OrthancPluginCheckVersionAdvanced(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 return PyLong_FromLong(value);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 static PyObject* sdk_OrthancPluginCheckVersion(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
41 PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersion()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 long value = OrthancPluginCheckVersion(OrthancPlugins::GetGlobalContext());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 return PyLong_FromLong(value);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 static PyObject* sdk_OrthancPluginLogError(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
51 PythonLock::LogCall("Calling Python global function: OrthancPluginLogError()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 OrthancPluginLogError(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 static PyObject* sdk_OrthancPluginLogWarning(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
69 PythonLock::LogCall("Calling Python global function: OrthancPluginLogWarning()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 OrthancPluginLogWarning(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 static PyObject* sdk_OrthancPluginLogInfo(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
87 PythonLock::LogCall("Calling Python global function: OrthancPluginLogInfo()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 OrthancPluginLogInfo(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 static PyObject* sdk_OrthancPluginGetDicomForInstance(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
105 PythonLock::LogCall("Calling Python global function: OrthancPluginGetDicomForInstance()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 OrthancPluginErrorCode code = OrthancPluginGetDicomForInstance(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
123 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 static PyObject* sdk_OrthancPluginRestApiGet(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
130 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiGet()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 OrthancPluginErrorCode code = OrthancPluginRestApiGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
148 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 static PyObject* sdk_OrthancPluginRestApiGetAfterPlugins(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
155 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiGetAfterPlugins()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 OrthancPluginErrorCode code = OrthancPluginRestApiGetAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
173 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 static PyObject* sdk_OrthancPluginRestApiPost(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
180 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPost()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 Py_buffer arg1;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 OrthancPluginErrorCode code = OrthancPluginRestApiPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 PyBuffer_Release(&arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
199 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 static PyObject* sdk_OrthancPluginRestApiPostAfterPlugins(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
206 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPostAfterPlugins()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 Py_buffer arg1;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 OrthancPluginErrorCode code = OrthancPluginRestApiPostAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 PyBuffer_Release(&arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
225 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 static PyObject* sdk_OrthancPluginRestApiDelete(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
232 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiDelete()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 OrthancPluginErrorCode code = OrthancPluginRestApiDelete(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
251 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 static PyObject* sdk_OrthancPluginRestApiDeleteAfterPlugins(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
258 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiDeleteAfterPlugins()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 OrthancPluginErrorCode code = OrthancPluginRestApiDeleteAfterPlugins(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
277 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 static PyObject* sdk_OrthancPluginRestApiPut(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
284 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPut()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 Py_buffer arg1;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 OrthancPluginErrorCode code = OrthancPluginRestApiPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 PyBuffer_Release(&arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
303 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 static PyObject* sdk_OrthancPluginRestApiPutAfterPlugins(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
310 PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPutAfterPlugins()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 Py_buffer arg1;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 OrthancPluginErrorCode code = OrthancPluginRestApiPutAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 PyBuffer_Release(&arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
329 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 static PyObject* sdk_OrthancPluginLookupPatient(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
336 PythonLock::LogCall("Calling Python global function: OrthancPluginLookupPatient()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 s.Assign(OrthancPluginLookupPatient(OrthancPlugins::GetGlobalContext(), arg0));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
350 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 static PyObject* sdk_OrthancPluginLookupStudy(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
361 PythonLock::LogCall("Calling Python global function: OrthancPluginLookupStudy()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 s.Assign(OrthancPluginLookupStudy(OrthancPlugins::GetGlobalContext(), arg0));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
375 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 static PyObject* sdk_OrthancPluginLookupStudyWithAccessionNumber(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
386 PythonLock::LogCall("Calling Python global function: OrthancPluginLookupStudyWithAccessionNumber()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 s.Assign(OrthancPluginLookupStudyWithAccessionNumber(OrthancPlugins::GetGlobalContext(), arg0));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
400 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 static PyObject* sdk_OrthancPluginLookupSeries(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
411 PythonLock::LogCall("Calling Python global function: OrthancPluginLookupSeries()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 s.Assign(OrthancPluginLookupSeries(OrthancPlugins::GetGlobalContext(), arg0));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
425 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 static PyObject* sdk_OrthancPluginLookupInstance(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
436 PythonLock::LogCall("Calling Python global function: OrthancPluginLookupInstance()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 s.Assign(OrthancPluginLookupInstance(OrthancPlugins::GetGlobalContext(), arg0));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
450 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 static PyObject* sdk_OrthancPluginGetOrthancPath(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
461 PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancPath()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 s.Assign(OrthancPluginGetOrthancPath(OrthancPlugins::GetGlobalContext()));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
469 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 static PyObject* sdk_OrthancPluginGetOrthancDirectory(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
480 PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancDirectory()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 s.Assign(OrthancPluginGetOrthancDirectory(OrthancPlugins::GetGlobalContext()));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
488 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 static PyObject* sdk_OrthancPluginGetConfigurationPath(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
499 PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfigurationPath()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 s.Assign(OrthancPluginGetConfigurationPath(OrthancPlugins::GetGlobalContext()));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
507 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 static PyObject* sdk_OrthancPluginSetRootUri(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
518 PythonLock::LogCall("Calling Python global function: OrthancPluginSetRootUri()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 OrthancPluginSetRootUri(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 static PyObject* sdk_OrthancPluginSetDescription(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
536 PythonLock::LogCall("Calling Python global function: OrthancPluginSetDescription()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 OrthancPluginSetDescription(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 static PyObject* sdk_OrthancPluginExtendOrthancExplorer(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
554 PythonLock::LogCall("Calling Python global function: OrthancPluginExtendOrthancExplorer()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 OrthancPluginExtendOrthancExplorer(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570 static PyObject* sdk_OrthancPluginGetGlobalProperty(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
572 PythonLock::LogCall("Calling Python global function: OrthancPluginGetGlobalProperty()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 const char* arg1 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 s.Assign(OrthancPluginGetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
587 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596 static PyObject* sdk_OrthancPluginSetGlobalProperty(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
598 PythonLock::LogCall("Calling Python global function: OrthancPluginSetGlobalProperty()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 const char* arg1 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 OrthancPluginErrorCode code = OrthancPluginSetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
618 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 static PyObject* sdk_OrthancPluginGetCommandLineArgumentsCount(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
625 PythonLock::LogCall("Calling Python global function: OrthancPluginGetCommandLineArgumentsCount()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 long value = OrthancPluginGetCommandLineArgumentsCount(OrthancPlugins::GetGlobalContext());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630 return PyLong_FromLong(value);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633 static PyObject* sdk_OrthancPluginGetCommandLineArgument(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
635 PythonLock::LogCall("Calling Python global function: OrthancPluginGetCommandLineArgument()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 unsigned long arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639 if (!PyArg_ParseTuple(args, "k", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 s.Assign(OrthancPluginGetCommandLineArgument(OrthancPlugins::GetGlobalContext(), arg0));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
649 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
657
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658 static PyObject* sdk_OrthancPluginGetExpectedDatabaseVersion(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
660 PythonLock::LogCall("Calling Python global function: OrthancPluginGetExpectedDatabaseVersion()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 long value = OrthancPluginGetExpectedDatabaseVersion(OrthancPlugins::GetGlobalContext());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 return PyLong_FromLong(value);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 static PyObject* sdk_OrthancPluginGetConfiguration(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
670 PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfiguration()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 s.Assign(OrthancPluginGetConfiguration(OrthancPlugins::GetGlobalContext()));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
678 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 static PyObject* sdk_OrthancPluginBufferCompression(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
689 PythonLock::LogCall("Calling Python global function: OrthancPluginBufferCompression()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 Py_buffer arg0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 unsigned char arg3 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695 if (!PyArg_ParseTuple(args, "s*lb", &arg0, &arg2, &arg3))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701 OrthancPluginErrorCode code = OrthancPluginBufferCompression(OrthancPlugins::GetGlobalContext(), *buffer, arg0.buf, arg0.len, static_cast<OrthancPluginCompressionType>(arg2), arg3);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 PyBuffer_Release(&arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
709 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714 static PyObject* sdk_OrthancPluginReadFile(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
716 PythonLock::LogCall("Calling Python global function: OrthancPluginReadFile()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 OrthancPluginErrorCode code = OrthancPluginReadFile(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
734 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 static PyObject* sdk_OrthancPluginWriteFile(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
741 PythonLock::LogCall("Calling Python global function: OrthancPluginWriteFile()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 Py_buffer arg1;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751 OrthancPluginErrorCode code = OrthancPluginWriteFile(OrthancPlugins::GetGlobalContext(), arg0, arg1.buf, arg1.len);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 PyBuffer_Release(&arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
761 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766 static PyObject* sdk_OrthancPluginGetErrorDescription(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
768 PythonLock::LogCall("Calling Python global function: OrthancPluginGetErrorDescription()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 if (!PyArg_ParseTuple(args, "l", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777 const char* s = OrthancPluginGetErrorDescription(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginErrorCode>(arg0));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779 if (s == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786 return PyUnicode_FromString(s);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 static PyObject* sdk_OrthancPluginUncompressImage(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
792 PythonLock::LogCall("Calling Python global function: OrthancPluginUncompressImage()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 Py_buffer arg0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 if (!PyArg_ParseTuple(args, "s*l", &arg0, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 // This is the case of a constructor
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 OrthancPluginImage* obj = OrthancPluginUncompressImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginImageFormat>(arg2));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 PyBuffer_Release(&arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 if (obj == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
807 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 Py_DECREF(argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 return python;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 static PyObject* sdk_OrthancPluginCompressPngImage(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
821 PythonLock::LogCall("Calling Python global function: OrthancPluginCompressPngImage()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 unsigned long arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825 unsigned long arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 unsigned long arg3 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 Py_buffer arg4;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829 if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 OrthancPluginErrorCode code = OrthancPluginCompressPngImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836 PyBuffer_Release(&arg4);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
843 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848 static PyObject* sdk_OrthancPluginCompressJpegImage(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
850 PythonLock::LogCall("Calling Python global function: OrthancPluginCompressJpegImage()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853 unsigned long arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 unsigned long arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 unsigned long arg3 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 Py_buffer arg4;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857 unsigned char arg5 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865 OrthancPluginErrorCode code = OrthancPluginCompressJpegImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 PyBuffer_Release(&arg4);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
873 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 static PyObject* sdk_OrthancPluginHttpGet(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
880 PythonLock::LogCall("Calling Python global function: OrthancPluginHttpGet()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883 const char* arg1 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 const char* arg2 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892 OrthancPluginErrorCode code = OrthancPluginHttpGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1, arg2);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
900 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905 static PyObject* sdk_OrthancPluginHttpPost(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
907 PythonLock::LogCall("Calling Python global function: OrthancPluginHttpPost()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 Py_buffer arg1;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911 const char* arg3 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912 const char* arg4 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 OrthancPluginErrorCode code = OrthancPluginHttpPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 PyBuffer_Release(&arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
928 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933 static PyObject* sdk_OrthancPluginHttpPut(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
935 PythonLock::LogCall("Calling Python global function: OrthancPluginHttpPut()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938 Py_buffer arg1;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939 const char* arg3 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 const char* arg4 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947 OrthancPlugins::MemoryBuffer buffer;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 OrthancPluginErrorCode code = OrthancPluginHttpPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 PyBuffer_Release(&arg1);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
956 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961 static PyObject* sdk_OrthancPluginHttpDelete(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
963 PythonLock::LogCall("Calling Python global function: OrthancPluginHttpDelete()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966 const char* arg1 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967 const char* arg2 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 OrthancPluginErrorCode code = OrthancPluginHttpDelete(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
984 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 static PyObject* sdk_OrthancPluginGetFontsCount(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
991 PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontsCount()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994 long value = OrthancPluginGetFontsCount(OrthancPlugins::GetGlobalContext());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996 return PyLong_FromLong(value);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999 static PyObject* sdk_OrthancPluginGetFontName(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1001 PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontName()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003 unsigned long arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005 if (!PyArg_ParseTuple(args, "k", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 const char* s = OrthancPluginGetFontName(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012 if (s == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019 return PyUnicode_FromString(s);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023 static PyObject* sdk_OrthancPluginGetFontSize(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1025 PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontSize()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027 unsigned long arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029 if (!PyArg_ParseTuple(args, "k", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034 long value = OrthancPluginGetFontSize(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 return PyLong_FromLong(value);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 static PyObject* sdk_OrthancPluginRegisterErrorCode(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1041 PythonLock::LogCall("Calling Python global function: OrthancPluginRegisterErrorCode()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044 unsigned short arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045 const char* arg2 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047 if (!PyArg_ParseTuple(args, "lHs", &arg0, &arg1, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052 OrthancPluginErrorCode code = OrthancPluginRegisterErrorCode(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1062 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 static PyObject* sdk_OrthancPluginRegisterDictionaryTag(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1069 PythonLock::LogCall("Calling Python global function: OrthancPluginRegisterDictionaryTag()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 unsigned short arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072 unsigned short arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 const char* arg3 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 unsigned long arg4 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076 unsigned long arg5 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078 if (!PyArg_ParseTuple(args, "HHlskk", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 OrthancPluginErrorCode code = OrthancPluginRegisterDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1093 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098 static PyObject* sdk_OrthancPluginRegisterPrivateDictionaryTag(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1100 PythonLock::LogCall("Calling Python global function: OrthancPluginRegisterPrivateDictionaryTag()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 unsigned short arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103 unsigned short arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 const char* arg3 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106 unsigned long arg4 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 unsigned long arg5 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 const char* arg6 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110 if (!PyArg_ParseTuple(args, "HHlskks", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115 OrthancPluginErrorCode code = OrthancPluginRegisterPrivateDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5, arg6);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118 if (code == OrthancPluginErrorCode_Success)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1125 PythonLock::RaiseException(code);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130 static PyObject* sdk_OrthancPluginDicomBufferToJson(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1132 PythonLock::LogCall("Calling Python global function: OrthancPluginDicomBufferToJson()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134 Py_buffer arg0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136 long int arg3 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 unsigned long arg4 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 if (!PyArg_ParseTuple(args, "s*llk", &arg0, &arg2, &arg3, &arg4))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145 s.Assign(OrthancPluginDicomBufferToJson(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginDicomToJsonFormat>(arg2), static_cast<OrthancPluginDicomToJsonFlags>(arg3), arg4));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 PyBuffer_Release(&arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1149 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158 static PyObject* sdk_OrthancPluginDicomInstanceToJson(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1160 PythonLock::LogCall("Calling Python global function: OrthancPluginDicomInstanceToJson()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 long int arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165 unsigned long arg3 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167 if (!PyArg_ParseTuple(args, "sllk", &arg0, &arg1, &arg2, &arg3))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173 s.Assign(OrthancPluginDicomInstanceToJson(OrthancPlugins::GetGlobalContext(), arg0, static_cast<OrthancPluginDicomToJsonFormat>(arg1), static_cast<OrthancPluginDicomToJsonFlags>(arg2), arg3));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1177 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186 static PyObject* sdk_OrthancPluginCreateImage(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1188 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateImage()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190 long int arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 unsigned long arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192 unsigned long arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194 if (!PyArg_ParseTuple(args, "lkk", &arg0, &arg1, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199 // This is the case of a constructor
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 OrthancPluginImage* obj = OrthancPluginCreateImage(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 if (obj == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1204 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211 Py_DECREF(argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212 return python;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216 static PyObject* sdk_OrthancPluginDecodeDicomImage(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1218 PythonLock::LogCall("Calling Python global function: OrthancPluginDecodeDicomImage()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 Py_buffer arg0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221 unsigned long arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 if (!PyArg_ParseTuple(args, "s*k", &arg0, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228 // This is the case of a constructor
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229 OrthancPluginImage* obj = OrthancPluginDecodeDicomImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230 PyBuffer_Release(&arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 if (obj == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1233 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240 Py_DECREF(argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241 return python;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245 static PyObject* sdk_OrthancPluginComputeMd5(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1247 PythonLock::LogCall("Calling Python global function: OrthancPluginComputeMd5()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249 Py_buffer arg0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 if (!PyArg_ParseTuple(args, "s*", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257 s.Assign(OrthancPluginComputeMd5(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258 PyBuffer_Release(&arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1261 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 static PyObject* sdk_OrthancPluginComputeSha1(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1271 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1272 PythonLock::LogCall("Calling Python global function: OrthancPluginComputeSha1()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1273
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274 Py_buffer arg0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276 if (!PyArg_ParseTuple(args, "s*", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 s.Assign(OrthancPluginComputeSha1(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 PyBuffer_Release(&arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1286 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 static PyObject* sdk_OrthancPluginGenerateUuid(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1297 PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateUuid()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 s.Assign(OrthancPluginGenerateUuid(OrthancPlugins::GetGlobalContext()));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1305 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1314 static PyObject* sdk_OrthancPluginCreateFindMatcher(PyObject* module, PyObject* args)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1315 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1316 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateFindMatcher()");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1317
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1318 Py_buffer arg0;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1319
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1320 if (!PyArg_ParseTuple(args, "s*", &arg0))
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1321 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1322 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1323 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1324 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1325 // This is the case of a constructor
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1326 OrthancPluginFindMatcher* obj = OrthancPluginCreateFindMatcher(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1327 PyBuffer_Release(&arg0);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1328 if (obj == NULL)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1329 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1330 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1331 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1332 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1333 else
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1334 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1335 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1336 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginFindMatcher_Type, argList);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1337 Py_DECREF(argList);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1338 return python;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1339 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1340 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1341
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1342 static PyObject* sdk_OrthancPluginGetPeers(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1343 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1344 PythonLock::LogCall("Calling Python global function: OrthancPluginGetPeers()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1345
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1346
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1347 // This is the case of a constructor
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1348 OrthancPluginPeers* obj = OrthancPluginGetPeers(OrthancPlugins::GetGlobalContext());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1349
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1350 if (obj == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1351 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1352 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1353 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1354 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1355 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1356 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1357 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1358 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginPeers_Type, argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1359 Py_DECREF(argList);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1360 return python;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1364 static PyObject* sdk_OrthancPluginAutodetectMimeType(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1366 PythonLock::LogCall("Calling Python global function: OrthancPluginAutodetectMimeType()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1368 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1369
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1370 if (!PyArg_ParseTuple(args, "s", &arg0))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1371 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1372 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1373 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1374 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1375 const char* s = OrthancPluginAutodetectMimeType(OrthancPlugins::GetGlobalContext(), arg0);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1376
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1377 if (s == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1378 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1379 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1380 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1381 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1382 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1383 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1384 return PyUnicode_FromString(s);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1385 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1386 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1387
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1388 static PyObject* sdk_OrthancPluginSetMetricsValue(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1389 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1390 PythonLock::LogCall("Calling Python global function: OrthancPluginSetMetricsValue()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1391
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1392 const char* arg0 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1393 float arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1394 long int arg2 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1395
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1396 if (!PyArg_ParseTuple(args, "sfl", &arg0, &arg1, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1397 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1398 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1399 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1400 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1401 OrthancPluginSetMetricsValue(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginMetricsType>(arg2));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1402
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1403
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1404 Py_INCREF(Py_None);
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1405 return Py_None;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1406 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1407
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1408 static PyObject* sdk_OrthancPluginGetTagName(PyObject* module, PyObject* args)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1409 {
28
b2bbb516056e The "Calling Python..." info logs are disabled if "PythonVerbose" is "false"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1
diff changeset
1410 PythonLock::LogCall("Calling Python global function: OrthancPluginGetTagName()");
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1411
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1412 unsigned short arg0 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1413 unsigned short arg1 = 0;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1414 const char* arg2 = NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1415
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1416 if (!PyArg_ParseTuple(args, "HHs", &arg0, &arg1, &arg2))
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1417 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1418 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1419 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1420 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1421 OrthancPlugins::OrthancString s;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1422 s.Assign(OrthancPluginGetTagName(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2));
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1423
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1424 if (s.GetContent() == NULL)
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1425 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1426 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1427 return NULL;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1428 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1429 else
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1430 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1431 return PyUnicode_FromString(s.GetContent());
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1432 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1433 }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1434
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1435 static PyObject* sdk_OrthancPluginCreateDicomInstance(PyObject* module, PyObject* args)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1436 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1437 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicomInstance()");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1438
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1439 Py_buffer arg0;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1440
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1441 if (!PyArg_ParseTuple(args, "s*", &arg0))
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1442 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1443 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1444 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1445 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1446 // This is the case of a constructor
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1447 OrthancPluginDicomInstance* obj = OrthancPluginCreateDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1448 PyBuffer_Release(&arg0);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1449 if (obj == NULL)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1450 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1451 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1452 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1453 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1454 else
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1455 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1456 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1457 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginDicomInstance_Type, argList);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1458 Py_DECREF(argList);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1459 return python;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1460 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1461 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1462
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1463 static PyObject* sdk_OrthancPluginTranscodeDicomInstance(PyObject* module, PyObject* args)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1464 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1465 PythonLock::LogCall("Calling Python global function: OrthancPluginTranscodeDicomInstance()");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1466
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1467 Py_buffer arg0;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1468 const char* arg2 = NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1469
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1470 if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2))
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1471 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1472 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1473 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1474 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1475 // This is the case of a constructor
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1476 OrthancPluginDicomInstance* obj = OrthancPluginTranscodeDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1477 PyBuffer_Release(&arg0);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1478 if (obj == NULL)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1479 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1480 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1481 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1482 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1483 else
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1484 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1485 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1486 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginDicomInstance_Type, argList);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1487 Py_DECREF(argList);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1488 return python;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1489 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1490 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1491
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1492 static PyObject* sdk_OrthancPluginCreateMemoryBuffer(PyObject* module, PyObject* args)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1493 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1494 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateMemoryBuffer()");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1495
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1496 unsigned long arg0 = 0;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1497
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1498 if (!PyArg_ParseTuple(args, "k", &arg0))
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1499 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1500 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1501 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1502 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1503 OrthancPlugins::MemoryBuffer buffer;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1504 OrthancPluginErrorCode code = OrthancPluginCreateMemoryBuffer(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1505
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1506 if (code == OrthancPluginErrorCode_Success)
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1507 {
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1508 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1509 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1510 else
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1511 {
77
e7ff5efb100d Custom exception "orthanc.OrthancException" is raised instead of "ValueError"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 75
diff changeset
1512 PythonLock::RaiseException(code);
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1513 return NULL;
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1514 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1515 }
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1516
49
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1517 static PyObject* sdk_OrthancPluginGenerateRestApiAuthorizationToken(PyObject* module, PyObject* args)
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1518 {
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1519 PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateRestApiAuthorizationToken()");
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1520
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1521
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1522 OrthancPlugins::OrthancString s;
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1523 s.Assign(OrthancPluginGenerateRestApiAuthorizationToken(OrthancPlugins::GetGlobalContext()));
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1524
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1525 if (s.GetContent() == NULL)
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1526 {
75
cbfc72a53970 refactoring calls to PythonLock::RaiseException()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 56
diff changeset
1527 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
49
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1528 return NULL;
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1529 }
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1530 else
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1531 {
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1532 return PyUnicode_FromString(s.GetContent());
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1533 }
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1534 }
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1535
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1536
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1537 static PyMethodDef ORTHANC_SDK_FUNCTIONS[] =
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1538 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1539 { "CheckVersionAdvanced", sdk_OrthancPluginCheckVersionAdvanced, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1540 "Generated from C function OrthancPluginCheckVersionAdvanced()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1541 { "CheckVersion", sdk_OrthancPluginCheckVersion, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1542 "Generated from C function OrthancPluginCheckVersion()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1543 { "LogError", sdk_OrthancPluginLogError, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1544 "Generated from C function OrthancPluginLogError()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1545 { "LogWarning", sdk_OrthancPluginLogWarning, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1546 "Generated from C function OrthancPluginLogWarning()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1547 { "LogInfo", sdk_OrthancPluginLogInfo, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1548 "Generated from C function OrthancPluginLogInfo()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1549 { "GetDicomForInstance", sdk_OrthancPluginGetDicomForInstance, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1550 "Generated from C function OrthancPluginGetDicomForInstance()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1551 { "RestApiGet", sdk_OrthancPluginRestApiGet, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1552 "Generated from C function OrthancPluginRestApiGet()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1553 { "RestApiGetAfterPlugins", sdk_OrthancPluginRestApiGetAfterPlugins, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1554 "Generated from C function OrthancPluginRestApiGetAfterPlugins()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1555 { "RestApiPost", sdk_OrthancPluginRestApiPost, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1556 "Generated from C function OrthancPluginRestApiPost()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1557 { "RestApiPostAfterPlugins", sdk_OrthancPluginRestApiPostAfterPlugins, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1558 "Generated from C function OrthancPluginRestApiPostAfterPlugins()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1559 { "RestApiDelete", sdk_OrthancPluginRestApiDelete, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1560 "Generated from C function OrthancPluginRestApiDelete()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1561 { "RestApiDeleteAfterPlugins", sdk_OrthancPluginRestApiDeleteAfterPlugins, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1562 "Generated from C function OrthancPluginRestApiDeleteAfterPlugins()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1563 { "RestApiPut", sdk_OrthancPluginRestApiPut, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1564 "Generated from C function OrthancPluginRestApiPut()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1565 { "RestApiPutAfterPlugins", sdk_OrthancPluginRestApiPutAfterPlugins, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1566 "Generated from C function OrthancPluginRestApiPutAfterPlugins()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1567 { "LookupPatient", sdk_OrthancPluginLookupPatient, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1568 "Generated from C function OrthancPluginLookupPatient()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1569 { "LookupStudy", sdk_OrthancPluginLookupStudy, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1570 "Generated from C function OrthancPluginLookupStudy()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1571 { "LookupStudyWithAccessionNumber", sdk_OrthancPluginLookupStudyWithAccessionNumber, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1572 "Generated from C function OrthancPluginLookupStudyWithAccessionNumber()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1573 { "LookupSeries", sdk_OrthancPluginLookupSeries, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1574 "Generated from C function OrthancPluginLookupSeries()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1575 { "LookupInstance", sdk_OrthancPluginLookupInstance, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1576 "Generated from C function OrthancPluginLookupInstance()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1577 { "GetOrthancPath", sdk_OrthancPluginGetOrthancPath, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1578 "Generated from C function OrthancPluginGetOrthancPath()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1579 { "GetOrthancDirectory", sdk_OrthancPluginGetOrthancDirectory, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1580 "Generated from C function OrthancPluginGetOrthancDirectory()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1581 { "GetConfigurationPath", sdk_OrthancPluginGetConfigurationPath, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1582 "Generated from C function OrthancPluginGetConfigurationPath()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1583 { "SetRootUri", sdk_OrthancPluginSetRootUri, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1584 "Generated from C function OrthancPluginSetRootUri()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1585 { "SetDescription", sdk_OrthancPluginSetDescription, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1586 "Generated from C function OrthancPluginSetDescription()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1587 { "ExtendOrthancExplorer", sdk_OrthancPluginExtendOrthancExplorer, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1588 "Generated from C function OrthancPluginExtendOrthancExplorer()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1589 { "GetGlobalProperty", sdk_OrthancPluginGetGlobalProperty, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1590 "Generated from C function OrthancPluginGetGlobalProperty()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1591 { "SetGlobalProperty", sdk_OrthancPluginSetGlobalProperty, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1592 "Generated from C function OrthancPluginSetGlobalProperty()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1593 { "GetCommandLineArgumentsCount", sdk_OrthancPluginGetCommandLineArgumentsCount, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1594 "Generated from C function OrthancPluginGetCommandLineArgumentsCount()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1595 { "GetCommandLineArgument", sdk_OrthancPluginGetCommandLineArgument, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1596 "Generated from C function OrthancPluginGetCommandLineArgument()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1597 { "GetExpectedDatabaseVersion", sdk_OrthancPluginGetExpectedDatabaseVersion, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1598 "Generated from C function OrthancPluginGetExpectedDatabaseVersion()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1599 { "GetConfiguration", sdk_OrthancPluginGetConfiguration, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1600 "Generated from C function OrthancPluginGetConfiguration()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1601 { "BufferCompression", sdk_OrthancPluginBufferCompression, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1602 "Generated from C function OrthancPluginBufferCompression()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1603 { "ReadFile", sdk_OrthancPluginReadFile, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1604 "Generated from C function OrthancPluginReadFile()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1605 { "WriteFile", sdk_OrthancPluginWriteFile, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1606 "Generated from C function OrthancPluginWriteFile()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1607 { "GetErrorDescription", sdk_OrthancPluginGetErrorDescription, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1608 "Generated from C function OrthancPluginGetErrorDescription()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1609 { "UncompressImage", sdk_OrthancPluginUncompressImage, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1610 "Generated from C function OrthancPluginUncompressImage()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1611 { "CompressPngImage", sdk_OrthancPluginCompressPngImage, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1612 "Generated from C function OrthancPluginCompressPngImage()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1613 { "CompressJpegImage", sdk_OrthancPluginCompressJpegImage, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1614 "Generated from C function OrthancPluginCompressJpegImage()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1615 { "HttpGet", sdk_OrthancPluginHttpGet, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1616 "Generated from C function OrthancPluginHttpGet()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1617 { "HttpPost", sdk_OrthancPluginHttpPost, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1618 "Generated from C function OrthancPluginHttpPost()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1619 { "HttpPut", sdk_OrthancPluginHttpPut, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1620 "Generated from C function OrthancPluginHttpPut()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1621 { "HttpDelete", sdk_OrthancPluginHttpDelete, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1622 "Generated from C function OrthancPluginHttpDelete()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1623 { "GetFontsCount", sdk_OrthancPluginGetFontsCount, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1624 "Generated from C function OrthancPluginGetFontsCount()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1625 { "GetFontName", sdk_OrthancPluginGetFontName, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1626 "Generated from C function OrthancPluginGetFontName()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1627 { "GetFontSize", sdk_OrthancPluginGetFontSize, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1628 "Generated from C function OrthancPluginGetFontSize()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1629 { "RegisterErrorCode", sdk_OrthancPluginRegisterErrorCode, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1630 "Generated from C function OrthancPluginRegisterErrorCode()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1631 { "RegisterDictionaryTag", sdk_OrthancPluginRegisterDictionaryTag, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1632 "Generated from C function OrthancPluginRegisterDictionaryTag()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1633 { "RegisterPrivateDictionaryTag", sdk_OrthancPluginRegisterPrivateDictionaryTag, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1634 "Generated from C function OrthancPluginRegisterPrivateDictionaryTag()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1635 { "DicomBufferToJson", sdk_OrthancPluginDicomBufferToJson, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1636 "Generated from C function OrthancPluginDicomBufferToJson()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1637 { "DicomInstanceToJson", sdk_OrthancPluginDicomInstanceToJson, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1638 "Generated from C function OrthancPluginDicomInstanceToJson()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1639 { "CreateImage", sdk_OrthancPluginCreateImage, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1640 "Generated from C function OrthancPluginCreateImage()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1641 { "DecodeDicomImage", sdk_OrthancPluginDecodeDicomImage, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1642 "Generated from C function OrthancPluginDecodeDicomImage()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1643 { "ComputeMd5", sdk_OrthancPluginComputeMd5, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1644 "Generated from C function OrthancPluginComputeMd5()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1645 { "ComputeSha1", sdk_OrthancPluginComputeSha1, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1646 "Generated from C function OrthancPluginComputeSha1()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1647 { "GenerateUuid", sdk_OrthancPluginGenerateUuid, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1648 "Generated from C function OrthancPluginGenerateUuid()" },
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1649 { "CreateFindMatcher", sdk_OrthancPluginCreateFindMatcher, METH_VARARGS,
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1650 "Generated from C function OrthancPluginCreateFindMatcher()" },
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1651 { "GetPeers", sdk_OrthancPluginGetPeers, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1652 "Generated from C function OrthancPluginGetPeers()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1653 { "AutodetectMimeType", sdk_OrthancPluginAutodetectMimeType, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1654 "Generated from C function OrthancPluginAutodetectMimeType()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1655 { "SetMetricsValue", sdk_OrthancPluginSetMetricsValue, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1656 "Generated from C function OrthancPluginSetMetricsValue()" },
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1657 { "GetTagName", sdk_OrthancPluginGetTagName, METH_VARARGS,
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1658 "Generated from C function OrthancPluginGetTagName()" },
41
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1659 { "CreateDicomInstance", sdk_OrthancPluginCreateDicomInstance, METH_VARARGS,
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1660 "Generated from C function OrthancPluginCreateDicomInstance()" },
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1661 { "TranscodeDicomInstance", sdk_OrthancPluginTranscodeDicomInstance, METH_VARARGS,
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1662 "Generated from C function OrthancPluginTranscodeDicomInstance()" },
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1663 { "CreateMemoryBuffer", sdk_OrthancPluginCreateMemoryBuffer, METH_VARARGS,
393d2da0722a upgrade to Orthanc SDK 1.7.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 28
diff changeset
1664 "Generated from C function OrthancPluginCreateMemoryBuffer()" },
49
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1665 { "GenerateRestApiAuthorizationToken", sdk_OrthancPluginGenerateRestApiAuthorizationToken, METH_VARARGS,
9e466631660a ugrade to Orthanc SDK 1.8.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 41
diff changeset
1666 "Generated from C function OrthancPluginGenerateRestApiAuthorizationToken()" },
1
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1667 { NULL, NULL }
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1668 };
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1669
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1670
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1671 PyMethodDef* GetOrthancSdkFunctions()
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1672 {
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1673 return ORTHANC_SDK_FUNCTIONS;
fef9a239df5c adding auto-generated files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1674 }