comparison Sources/Autogenerated/sdk_OrthancPluginRestOutput.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
140 { 140 {
141 PythonLock::LogCall("Calling method OrthancPluginAnswerBuffer() on object of class OrthancPluginRestOutput"); 141 PythonLock::LogCall("Calling method OrthancPluginAnswerBuffer() on object of class OrthancPluginRestOutput");
142 142
143 if (self->object_ == NULL) 143 if (self->object_ == NULL)
144 { 144 {
145 // TODO: RAISE
146 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
147 PyErr_SetString(PyExc_ValueError, "Invalid object"); 145 PyErr_SetString(PyExc_ValueError, "Invalid object");
148 return NULL; 146 return NULL;
149 } 147 }
150 148
151 Py_buffer arg0; 149 Py_buffer arg0;
152 const char* arg2 = NULL; 150 const char* arg2 = NULL;
153 151
154 if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2)) 152 if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2))
155 { 153 {
156 // TODO => RAISE : https://stackoverflow.com/questions/60832317
157 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 154 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
158 return NULL; 155 return NULL;
159 } 156 }
160 OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len, arg2); 157 OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len, arg2);
161 PyBuffer_Release(&arg0); 158 PyBuffer_Release(&arg0);
169 { 166 {
170 PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerPngImage() on object of class OrthancPluginRestOutput"); 167 PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerPngImage() on object of class OrthancPluginRestOutput");
171 168
172 if (self->object_ == NULL) 169 if (self->object_ == NULL)
173 { 170 {
174 // TODO: RAISE
175 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
176 PyErr_SetString(PyExc_ValueError, "Invalid object"); 171 PyErr_SetString(PyExc_ValueError, "Invalid object");
177 return NULL; 172 return NULL;
178 } 173 }
179 174
180 long int arg0 = 0; 175 long int arg0 = 0;
183 unsigned long arg3 = 0; 178 unsigned long arg3 = 0;
184 Py_buffer arg4; 179 Py_buffer arg4;
185 180
186 if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4)) 181 if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4))
187 { 182 {
188 // TODO => RAISE : https://stackoverflow.com/questions/60832317
189 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)"); 183 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)");
190 return NULL; 184 return NULL;
191 } 185 }
192 OrthancPluginCompressAndAnswerPngImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf); 186 OrthancPluginCompressAndAnswerPngImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf);
193 PyBuffer_Release(&arg4); 187 PyBuffer_Release(&arg4);
201 { 195 {
202 PythonLock::LogCall("Calling method OrthancPluginRedirect() on object of class OrthancPluginRestOutput"); 196 PythonLock::LogCall("Calling method OrthancPluginRedirect() on object of class OrthancPluginRestOutput");
203 197
204 if (self->object_ == NULL) 198 if (self->object_ == NULL)
205 { 199 {
206 // TODO: RAISE
207 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
208 PyErr_SetString(PyExc_ValueError, "Invalid object"); 200 PyErr_SetString(PyExc_ValueError, "Invalid object");
209 return NULL; 201 return NULL;
210 } 202 }
211 203
212 const char* arg0 = NULL; 204 const char* arg0 = NULL;
213 205
214 if (!PyArg_ParseTuple(args, "s", &arg0)) 206 if (!PyArg_ParseTuple(args, "s", &arg0))
215 { 207 {
216 // TODO => RAISE : https://stackoverflow.com/questions/60832317
217 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 208 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
218 return NULL; 209 return NULL;
219 } 210 }
220 OrthancPluginRedirect(OrthancPlugins::GetGlobalContext(), self->object_, arg0); 211 OrthancPluginRedirect(OrthancPlugins::GetGlobalContext(), self->object_, arg0);
221 212
229 { 220 {
230 PythonLock::LogCall("Calling method OrthancPluginSendHttpStatusCode() on object of class OrthancPluginRestOutput"); 221 PythonLock::LogCall("Calling method OrthancPluginSendHttpStatusCode() on object of class OrthancPluginRestOutput");
231 222
232 if (self->object_ == NULL) 223 if (self->object_ == NULL)
233 { 224 {
234 // TODO: RAISE
235 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
236 PyErr_SetString(PyExc_ValueError, "Invalid object"); 225 PyErr_SetString(PyExc_ValueError, "Invalid object");
237 return NULL; 226 return NULL;
238 } 227 }
239 228
240 unsigned short arg0 = 0; 229 unsigned short arg0 = 0;
241 230
242 if (!PyArg_ParseTuple(args, "H", &arg0)) 231 if (!PyArg_ParseTuple(args, "H", &arg0))
243 { 232 {
244 // TODO => RAISE : https://stackoverflow.com/questions/60832317
245 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 233 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
246 return NULL; 234 return NULL;
247 } 235 }
248 OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), self->object_, arg0); 236 OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), self->object_, arg0);
249 237
257 { 245 {
258 PythonLock::LogCall("Calling method OrthancPluginSendUnauthorized() on object of class OrthancPluginRestOutput"); 246 PythonLock::LogCall("Calling method OrthancPluginSendUnauthorized() on object of class OrthancPluginRestOutput");
259 247
260 if (self->object_ == NULL) 248 if (self->object_ == NULL)
261 { 249 {
262 // TODO: RAISE
263 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
264 PyErr_SetString(PyExc_ValueError, "Invalid object"); 250 PyErr_SetString(PyExc_ValueError, "Invalid object");
265 return NULL; 251 return NULL;
266 } 252 }
267 253
268 const char* arg0 = NULL; 254 const char* arg0 = NULL;
269 255
270 if (!PyArg_ParseTuple(args, "s", &arg0)) 256 if (!PyArg_ParseTuple(args, "s", &arg0))
271 { 257 {
272 // TODO => RAISE : https://stackoverflow.com/questions/60832317
273 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 258 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
274 return NULL; 259 return NULL;
275 } 260 }
276 OrthancPluginSendUnauthorized(OrthancPlugins::GetGlobalContext(), self->object_, arg0); 261 OrthancPluginSendUnauthorized(OrthancPlugins::GetGlobalContext(), self->object_, arg0);
277 262
285 { 270 {
286 PythonLock::LogCall("Calling method OrthancPluginSendMethodNotAllowed() on object of class OrthancPluginRestOutput"); 271 PythonLock::LogCall("Calling method OrthancPluginSendMethodNotAllowed() on object of class OrthancPluginRestOutput");
287 272
288 if (self->object_ == NULL) 273 if (self->object_ == NULL)
289 { 274 {
290 // TODO: RAISE
291 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
292 PyErr_SetString(PyExc_ValueError, "Invalid object"); 275 PyErr_SetString(PyExc_ValueError, "Invalid object");
293 return NULL; 276 return NULL;
294 } 277 }
295 278
296 const char* arg0 = NULL; 279 const char* arg0 = NULL;
297 280
298 if (!PyArg_ParseTuple(args, "s", &arg0)) 281 if (!PyArg_ParseTuple(args, "s", &arg0))
299 { 282 {
300 // TODO => RAISE : https://stackoverflow.com/questions/60832317
301 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 283 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
302 return NULL; 284 return NULL;
303 } 285 }
304 OrthancPluginSendMethodNotAllowed(OrthancPlugins::GetGlobalContext(), self->object_, arg0); 286 OrthancPluginSendMethodNotAllowed(OrthancPlugins::GetGlobalContext(), self->object_, arg0);
305 287
313 { 295 {
314 PythonLock::LogCall("Calling method OrthancPluginSetCookie() on object of class OrthancPluginRestOutput"); 296 PythonLock::LogCall("Calling method OrthancPluginSetCookie() on object of class OrthancPluginRestOutput");
315 297
316 if (self->object_ == NULL) 298 if (self->object_ == NULL)
317 { 299 {
318 // TODO: RAISE
319 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
320 PyErr_SetString(PyExc_ValueError, "Invalid object"); 300 PyErr_SetString(PyExc_ValueError, "Invalid object");
321 return NULL; 301 return NULL;
322 } 302 }
323 303
324 const char* arg0 = NULL; 304 const char* arg0 = NULL;
325 const char* arg1 = NULL; 305 const char* arg1 = NULL;
326 306
327 if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) 307 if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1))
328 { 308 {
329 // TODO => RAISE : https://stackoverflow.com/questions/60832317
330 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 309 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
331 return NULL; 310 return NULL;
332 } 311 }
333 OrthancPluginSetCookie(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); 312 OrthancPluginSetCookie(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1);
334 313
342 { 321 {
343 PythonLock::LogCall("Calling method OrthancPluginSetHttpHeader() on object of class OrthancPluginRestOutput"); 322 PythonLock::LogCall("Calling method OrthancPluginSetHttpHeader() on object of class OrthancPluginRestOutput");
344 323
345 if (self->object_ == NULL) 324 if (self->object_ == NULL)
346 { 325 {
347 // TODO: RAISE
348 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
349 PyErr_SetString(PyExc_ValueError, "Invalid object"); 326 PyErr_SetString(PyExc_ValueError, "Invalid object");
350 return NULL; 327 return NULL;
351 } 328 }
352 329
353 const char* arg0 = NULL; 330 const char* arg0 = NULL;
354 const char* arg1 = NULL; 331 const char* arg1 = NULL;
355 332
356 if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) 333 if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1))
357 { 334 {
358 // TODO => RAISE : https://stackoverflow.com/questions/60832317
359 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 335 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
360 return NULL; 336 return NULL;
361 } 337 }
362 OrthancPluginSetHttpHeader(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); 338 OrthancPluginSetHttpHeader(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1);
363 339
371 { 347 {
372 PythonLock::LogCall("Calling method OrthancPluginStartMultipartAnswer() on object of class OrthancPluginRestOutput"); 348 PythonLock::LogCall("Calling method OrthancPluginStartMultipartAnswer() on object of class OrthancPluginRestOutput");
373 349
374 if (self->object_ == NULL) 350 if (self->object_ == NULL)
375 { 351 {
376 // TODO: RAISE
377 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
378 PyErr_SetString(PyExc_ValueError, "Invalid object"); 352 PyErr_SetString(PyExc_ValueError, "Invalid object");
379 return NULL; 353 return NULL;
380 } 354 }
381 355
382 const char* arg0 = NULL; 356 const char* arg0 = NULL;
383 const char* arg1 = NULL; 357 const char* arg1 = NULL;
384 358
385 if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) 359 if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1))
386 { 360 {
387 // TODO => RAISE : https://stackoverflow.com/questions/60832317
388 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 361 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
389 return NULL; 362 return NULL;
390 } 363 }
391 OrthancPluginErrorCode code = OrthancPluginStartMultipartAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); 364 OrthancPluginErrorCode code = OrthancPluginStartMultipartAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1);
392 365
396 Py_INCREF(Py_None); 369 Py_INCREF(Py_None);
397 return Py_None; 370 return Py_None;
398 } 371 }
399 else 372 else
400 { 373 {
401 // TODO => RAISE : https://stackoverflow.com/questions/60832317 374 PythonLock::RaiseException(code);
402 //PythonLock::RaiseException(module, code);
403 PyErr_SetString(PyExc_ValueError, "Internal error");
404 return NULL; 375 return NULL;
405 } 376 }
406 } 377 }
407 378
408 static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMultipartItem( 379 static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMultipartItem(
410 { 381 {
411 PythonLock::LogCall("Calling method OrthancPluginSendMultipartItem() on object of class OrthancPluginRestOutput"); 382 PythonLock::LogCall("Calling method OrthancPluginSendMultipartItem() on object of class OrthancPluginRestOutput");
412 383
413 if (self->object_ == NULL) 384 if (self->object_ == NULL)
414 { 385 {
415 // TODO: RAISE
416 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
417 PyErr_SetString(PyExc_ValueError, "Invalid object"); 386 PyErr_SetString(PyExc_ValueError, "Invalid object");
418 return NULL; 387 return NULL;
419 } 388 }
420 389
421 Py_buffer arg0; 390 Py_buffer arg0;
422 391
423 if (!PyArg_ParseTuple(args, "s*", &arg0)) 392 if (!PyArg_ParseTuple(args, "s*", &arg0))
424 { 393 {
425 // TODO => RAISE : https://stackoverflow.com/questions/60832317
426 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 394 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
427 return NULL; 395 return NULL;
428 } 396 }
429 OrthancPluginErrorCode code = OrthancPluginSendMultipartItem(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); 397 OrthancPluginErrorCode code = OrthancPluginSendMultipartItem(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len);
430 PyBuffer_Release(&arg0); 398 PyBuffer_Release(&arg0);
434 Py_INCREF(Py_None); 402 Py_INCREF(Py_None);
435 return Py_None; 403 return Py_None;
436 } 404 }
437 else 405 else
438 { 406 {
439 // TODO => RAISE : https://stackoverflow.com/questions/60832317 407 PythonLock::RaiseException(code);
440 //PythonLock::RaiseException(module, code);
441 PyErr_SetString(PyExc_ValueError, "Internal error");
442 return NULL; 408 return NULL;
443 } 409 }
444 } 410 }
445 411
446 static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatus( 412 static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatus(
448 { 414 {
449 PythonLock::LogCall("Calling method OrthancPluginSendHttpStatus() on object of class OrthancPluginRestOutput"); 415 PythonLock::LogCall("Calling method OrthancPluginSendHttpStatus() on object of class OrthancPluginRestOutput");
450 416
451 if (self->object_ == NULL) 417 if (self->object_ == NULL)
452 { 418 {
453 // TODO: RAISE
454 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
455 PyErr_SetString(PyExc_ValueError, "Invalid object"); 419 PyErr_SetString(PyExc_ValueError, "Invalid object");
456 return NULL; 420 return NULL;
457 } 421 }
458 422
459 unsigned short arg0 = 0; 423 unsigned short arg0 = 0;
460 const char* arg1 = NULL; 424 const char* arg1 = NULL;
461 unsigned long arg2 = 0; 425 unsigned long arg2 = 0;
462 426
463 if (!PyArg_ParseTuple(args, "Hsk", &arg0, &arg1, &arg2)) 427 if (!PyArg_ParseTuple(args, "Hsk", &arg0, &arg1, &arg2))
464 { 428 {
465 // TODO => RAISE : https://stackoverflow.com/questions/60832317
466 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 429 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
467 return NULL; 430 return NULL;
468 } 431 }
469 OrthancPluginSendHttpStatus(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2); 432 OrthancPluginSendHttpStatus(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2);
470 433
478 { 441 {
479 PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerJpegImage() on object of class OrthancPluginRestOutput"); 442 PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerJpegImage() on object of class OrthancPluginRestOutput");
480 443
481 if (self->object_ == NULL) 444 if (self->object_ == NULL)
482 { 445 {
483 // TODO: RAISE
484 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
485 PyErr_SetString(PyExc_ValueError, "Invalid object"); 446 PyErr_SetString(PyExc_ValueError, "Invalid object");
486 return NULL; 447 return NULL;
487 } 448 }
488 449
489 long int arg0 = 0; 450 long int arg0 = 0;
493 Py_buffer arg4; 454 Py_buffer arg4;
494 unsigned char arg5 = 0; 455 unsigned char arg5 = 0;
495 456
496 if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) 457 if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
497 { 458 {
498 // TODO => RAISE : https://stackoverflow.com/questions/60832317
499 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); 459 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)");
500 return NULL; 460 return NULL;
501 } 461 }
502 OrthancPluginCompressAndAnswerJpegImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5); 462 OrthancPluginCompressAndAnswerJpegImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5);
503 PyBuffer_Release(&arg4); 463 PyBuffer_Release(&arg4);
511 { 471 {
512 PythonLock::LogCall("Calling method OrthancPluginSetHttpErrorDetails() on object of class OrthancPluginRestOutput"); 472 PythonLock::LogCall("Calling method OrthancPluginSetHttpErrorDetails() on object of class OrthancPluginRestOutput");
513 473
514 if (self->object_ == NULL) 474 if (self->object_ == NULL)
515 { 475 {
516 // TODO: RAISE
517 //PythonLock::RaiseException(module, OrthancPluginErrorCode_NullPointer);
518 PyErr_SetString(PyExc_ValueError, "Invalid object"); 476 PyErr_SetString(PyExc_ValueError, "Invalid object");
519 return NULL; 477 return NULL;
520 } 478 }
521 479
522 const char* arg0 = NULL; 480 const char* arg0 = NULL;
523 unsigned char arg1 = 0; 481 unsigned char arg1 = 0;
524 482
525 if (!PyArg_ParseTuple(args, "sb", &arg0, &arg1)) 483 if (!PyArg_ParseTuple(args, "sb", &arg0, &arg1))
526 { 484 {
527 // TODO => RAISE : https://stackoverflow.com/questions/60832317
528 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 485 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
529 return NULL; 486 return NULL;
530 } 487 }
531 OrthancPluginSetHttpErrorDetails(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); 488 OrthancPluginSetHttpErrorDetails(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1);
532 489