Mercurial > hg > orthanc-python
annotate Sources/Autogenerated/sdk_OrthancPluginJob.methods.h @ 129:5643e97d9367 fix-leak
reproducible code generation
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 30 Aug 2023 11:40:22 +0200 |
parents | |
children | 6288b8132659 |
rev | line source |
---|---|
129
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 // Actual implementation of the methods |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 static PyObject *sdk_OrthancPluginJob_OrthancPluginSubmitJob( |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 sdk_OrthancPluginJob_Object* self, PyObject *args) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 PythonLock::LogCall("Calling method OrthancPluginSubmitJob() on object of class OrthancPluginJob"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 if (self->object_ == NULL) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 PyErr_SetString(PyExc_ValueError, "Invalid object"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 return NULL; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 int arg0 = 0; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 if (!PyArg_ParseTuple(args, "i", &arg0)) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 return NULL; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 OrthancPlugins::OrthancString s; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 s.Assign(OrthancPluginSubmitJob(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 if (s.GetContent() == NULL) |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 return NULL; |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 else |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 { |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 return PyUnicode_FromString(s.GetContent()); |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 } |
5643e97d9367
reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |