Mercurial > hg > orthanc-python
comparison Sources/Autogenerated/sdk_OrthancPluginPeers.impl.h @ 75:cbfc72a53970
refactoring calls to PythonLock::RaiseException()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 09 Aug 2021 16:59:59 +0200 |
parents | 32de70a1e4c7 |
children | eb6ac5a801d1 |
comparison
equal
deleted
inserted
replaced
73:da73be4b361b | 75:cbfc72a53970 |
---|---|
110 { | 110 { |
111 PythonLock::LogCall("Calling method OrthancPluginGetPeersCount() on object of class OrthancPluginPeers"); | 111 PythonLock::LogCall("Calling method OrthancPluginGetPeersCount() on object of class OrthancPluginPeers"); |
112 | 112 |
113 if (self->object_ == NULL) | 113 if (self->object_ == NULL) |
114 { | 114 { |
115 // TODO: RAISE | |
116 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer); | |
117 PyErr_SetString(PyExc_ValueError, "Invalid object"); | 115 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
118 return NULL; | 116 return NULL; |
119 } | 117 } |
120 | 118 |
121 | 119 |
129 { | 127 { |
130 PythonLock::LogCall("Calling method OrthancPluginGetPeerName() on object of class OrthancPluginPeers"); | 128 PythonLock::LogCall("Calling method OrthancPluginGetPeerName() on object of class OrthancPluginPeers"); |
131 | 129 |
132 if (self->object_ == NULL) | 130 if (self->object_ == NULL) |
133 { | 131 { |
134 // TODO: RAISE | |
135 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer); | |
136 PyErr_SetString(PyExc_ValueError, "Invalid object"); | 132 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
137 return NULL; | 133 return NULL; |
138 } | 134 } |
139 | 135 |
140 unsigned long arg0 = 0; | 136 unsigned long arg0 = 0; |
141 | 137 |
142 if (!PyArg_ParseTuple(args, "k", &arg0)) | 138 if (!PyArg_ParseTuple(args, "k", &arg0)) |
143 { | 139 { |
144 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
145 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | 140 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); |
146 return NULL; | 141 return NULL; |
147 } | 142 } |
148 const char* s = OrthancPluginGetPeerName(OrthancPlugins::GetGlobalContext(), self->object_, arg0); | 143 const char* s = OrthancPluginGetPeerName(OrthancPlugins::GetGlobalContext(), self->object_, arg0); |
149 | 144 |
163 { | 158 { |
164 PythonLock::LogCall("Calling method OrthancPluginGetPeerUrl() on object of class OrthancPluginPeers"); | 159 PythonLock::LogCall("Calling method OrthancPluginGetPeerUrl() on object of class OrthancPluginPeers"); |
165 | 160 |
166 if (self->object_ == NULL) | 161 if (self->object_ == NULL) |
167 { | 162 { |
168 // TODO: RAISE | |
169 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer); | |
170 PyErr_SetString(PyExc_ValueError, "Invalid object"); | 163 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
171 return NULL; | 164 return NULL; |
172 } | 165 } |
173 | 166 |
174 unsigned long arg0 = 0; | 167 unsigned long arg0 = 0; |
175 | 168 |
176 if (!PyArg_ParseTuple(args, "k", &arg0)) | 169 if (!PyArg_ParseTuple(args, "k", &arg0)) |
177 { | 170 { |
178 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
179 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | 171 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); |
180 return NULL; | 172 return NULL; |
181 } | 173 } |
182 const char* s = OrthancPluginGetPeerUrl(OrthancPlugins::GetGlobalContext(), self->object_, arg0); | 174 const char* s = OrthancPluginGetPeerUrl(OrthancPlugins::GetGlobalContext(), self->object_, arg0); |
183 | 175 |
197 { | 189 { |
198 PythonLock::LogCall("Calling method OrthancPluginGetPeerUserProperty() on object of class OrthancPluginPeers"); | 190 PythonLock::LogCall("Calling method OrthancPluginGetPeerUserProperty() on object of class OrthancPluginPeers"); |
199 | 191 |
200 if (self->object_ == NULL) | 192 if (self->object_ == NULL) |
201 { | 193 { |
202 // TODO: RAISE | |
203 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer); | |
204 PyErr_SetString(PyExc_ValueError, "Invalid object"); | 194 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
205 return NULL; | 195 return NULL; |
206 } | 196 } |
207 | 197 |
208 unsigned long arg0 = 0; | 198 unsigned long arg0 = 0; |
209 const char* arg1 = NULL; | 199 const char* arg1 = NULL; |
210 | 200 |
211 if (!PyArg_ParseTuple(args, "ks", &arg0, &arg1)) | 201 if (!PyArg_ParseTuple(args, "ks", &arg0, &arg1)) |
212 { | 202 { |
213 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
214 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | 203 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); |
215 return NULL; | 204 return NULL; |
216 } | 205 } |
217 const char* s = OrthancPluginGetPeerUserProperty(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); | 206 const char* s = OrthancPluginGetPeerUserProperty(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); |
218 | 207 |