Mercurial > hg > orthanc-python
changeset 131:c55b0583084b
integration fix-leak->mainline
line wrap: on
line diff
--- a/CMakeLists.txt Wed Aug 30 11:49:59 2023 +0200 +++ b/CMakeLists.txt Wed Aug 30 11:52:45 2023 +0200 @@ -178,6 +178,7 @@ Sources/OnChangeCallback.cpp Sources/OnStoredInstanceCallback.cpp Sources/Plugin.cpp + Sources/PythonBytes.cpp Sources/PythonFunction.cpp Sources/PythonLock.cpp Sources/PythonModule.cpp
--- a/CodeAnalysis/Class.mustache Wed Aug 30 11:49:59 2023 +0200 +++ b/CodeAnalysis/Class.mustache Wed Aug 30 11:52:45 2023 +0200 @@ -105,25 +105,6 @@ {{/destructor}} -// Actual implementation of the methods -{{#methods}} -static PyObject *sdk_{{class_name}}_{{c_function}}( - sdk_{{class_name}}_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method {{c_function}}() on object of class {{class_name}}"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - -{{> function_body}} -} - -{{/methods}} - - static void Register{{class_name}}Class(PyObject* module) { sdk_{{class_name}}_Type.tp_new = PyType_GenericNew;
--- a/CodeAnalysis/Enumeration.mustache Wed Aug 30 11:49:59 2023 +0200 +++ b/CodeAnalysis/Enumeration.mustache Wed Aug 30 11:52:45 2023 +0200 @@ -65,7 +65,12 @@ **/ {{#values}} - PyDict_SetItemString(sdk_{{name}}_Type.tp_dict, "{{key}}", PyLong_FromLong({{value}})); + { + PyObject* tmp = PyLong_FromLong({{value}}); + PyDict_SetItemString(sdk_{{name}}_Type.tp_dict, "{{key}}", tmp); + Py_DECREF(tmp); + } + {{/values}} Py_INCREF(&sdk_{{name}}_Type);
--- a/CodeAnalysis/ParseOrthancSDK.py Wed Aug 30 11:49:59 2023 +0200 +++ b/CodeAnalysis/ParseOrthancSDK.py Wed Aug 30 11:52:45 2023 +0200 @@ -509,14 +509,18 @@ ) with open(os.path.join(ROOT, 'Class.mustache'), 'r') as f: - template = f.read() + with open(os.path.join(ROOT, 'ClassMethods.mustache'), 'r') as g: + classDefinition = f.read() + classMethods = g.read() - for method in CUSTOM_METHODS: - classes[method['class_name']]['custom_methods'].append(method) - - for (key, value) in classes.items(): - with open(os.path.join(TARGET, 'sdk_%s.impl.h' % value['class_name']), 'w') as h: - h.write(renderer.render(template, value)) + for method in CUSTOM_METHODS: + classes[method['class_name']]['custom_methods'].append(method) + + for (key, value) in classes.items(): + with open(os.path.join(TARGET, 'sdk_%s.impl.h' % value['class_name']), 'w') as h: + h.write(renderer.render(classDefinition, value)) + with open(os.path.join(TARGET, 'sdk_%s.methods.h' % value['class_name']), 'w') as h: + h.write(renderer.render(classMethods, value)) def FlattenDictionary(source): @@ -525,7 +529,11 @@ result.append(value) return result - + +sortedClasses = sorted(FlattenDictionary(classes), key = lambda x: x['class_name']) +sortedEnumerations = sorted(FlattenDictionary(enumerations), key = lambda x: x['name']) +sortedGlobalFunctions = sorted(globalFunctions, key = lambda x: x['c_function']) + with open(os.path.join(ROOT, 'GlobalFunctions.mustache'), 'r') as f: with open(os.path.join(TARGET, 'sdk_GlobalFunctions.impl.h'), 'w') as h: h.write(renderer.render(f.read(), { @@ -535,15 +543,15 @@ with open(os.path.join(ROOT, 'sdk.cpp.mustache'), 'r') as f: with open(os.path.join(TARGET, 'sdk.cpp'), 'w') as h: h.write(renderer.render(f.read(), { - 'classes' : FlattenDictionary(classes), - 'enumerations' : FlattenDictionary(enumerations), + 'classes' : sortedClasses, + 'enumerations' : sortedEnumerations, 'global_functions' : globalFunctions, })) with open(os.path.join(ROOT, 'sdk.h.mustache'), 'r') as f: with open(os.path.join(TARGET, 'sdk.h'), 'w') as h: h.write(renderer.render(f.read(), { - 'classes' : FlattenDictionary(classes), + 'classes' : sortedClasses, }))
--- a/CodeAnalysis/README.txt Wed Aug 30 11:49:59 2023 +0200 +++ b/CodeAnalysis/README.txt Wed Aug 30 11:52:45 2023 +0200 @@ -11,12 +11,21 @@ Usage on Ubuntu 18.04 ===================== -$ sudo apt-get install python-clang-4.0 +$ sudo apt-get install python-clang-4.0 python-pystache $ python2 ./ParseOrthancSDK.py --libclang=libclang-4.0.so.1 \ --source ../Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h \ --target ../Sources/Autogenerated +Usage on Ubuntu 20.04 +===================== + +$ sudo apt-get install python-clang-6.0 python3-pystache +$ python3 ./ParseOrthancSDK.py --libclang=libclang-6.0.so.1 \ + --source ../Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h \ + --target ../Sources/Autogenerated + + Run through docker ==================
--- a/CodeAnalysis/sdk.cpp.mustache Wed Aug 30 11:49:59 2023 +0200 +++ b/CodeAnalysis/sdk.cpp.mustache Wed Aug 30 11:52:45 2023 +0200 @@ -34,6 +34,10 @@ #include "./sdk_GlobalFunctions.impl.h" +{{#classes}} +#include "./sdk_{{class_name}}.methods.h" +{{/classes}} + void RegisterOrthancSdk(PyObject* module) { {{#enumerations}}
--- a/CodeAnalysis/sdk.h.mustache Wed Aug 30 11:49:59 2023 +0200 +++ b/CodeAnalysis/sdk.h.mustache Wed Aug 30 11:52:45 2023 +0200 @@ -32,7 +32,7 @@ #include <orthanc/OrthancCPlugin.h> {{#classes}} -typedef struct +typedef struct { PyObject_HEAD
--- a/NEWS Wed Aug 30 11:49:59 2023 +0200 +++ b/NEWS Wed Aug 30 11:52:45 2023 +0200 @@ -3,8 +3,15 @@ * New functions from the SDK wrapped in Python: - orthanc.RegisterStorageCommitmentScpCallback() +* New configuration section "Python" to group settings related to the plugin: + - "Python.Path" is an alias for global option "PythonScript" + - "Python.Verbose" is an alias for global option "PythonVerbose" +* New configuration option "Python.DisplayMemoryUsage" to periodically + display memory allocations that stem from Python plugins -Maintenance: +Maintenance +----------- + * Fix memory leaks when a python script calls orthanc.RestApiPost() and sibling methods, in IncomingHttpRequestFilter and in the CMove callback. * New builders for Windows: Supporting 32 / 64bit with Python 3.9 / 3.10 / 3.11
--- a/Sources/Autogenerated/sdk.cpp Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk.cpp Wed Aug 30 11:52:45 2023 +0200 @@ -24,79 +24,93 @@ #include "../../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" +#include "./sdk_OrthancPluginChangeType.impl.h" +#include "./sdk_OrthancPluginCompressionType.impl.h" +#include "./sdk_OrthancPluginConstraintType.impl.h" +#include "./sdk_OrthancPluginContentType.impl.h" +#include "./sdk_OrthancPluginCreateDicomFlags.impl.h" +#include "./sdk_OrthancPluginDicomToJsonFlags.impl.h" +#include "./sdk_OrthancPluginDicomToJsonFormat.impl.h" +#include "./sdk_OrthancPluginDicomWebBinaryMode.impl.h" +#include "./sdk_OrthancPluginErrorCode.impl.h" +#include "./sdk_OrthancPluginHttpMethod.impl.h" +#include "./sdk_OrthancPluginIdentifierConstraint.impl.h" +#include "./sdk_OrthancPluginImageFormat.impl.h" #include "./sdk_OrthancPluginInstanceOrigin.impl.h" #include "./sdk_OrthancPluginJobStepStatus.impl.h" -#include "./sdk_OrthancPluginDicomWebBinaryMode.impl.h" -#include "./sdk_OrthancPluginHttpMethod.impl.h" -#include "./sdk_OrthancPluginResourceType.impl.h" -#include "./sdk_OrthancPluginConstraintType.impl.h" +#include "./sdk_OrthancPluginJobStopReason.impl.h" +#include "./sdk_OrthancPluginMetricsType.impl.h" #include "./sdk_OrthancPluginPixelFormat.impl.h" -#include "./sdk_OrthancPluginCompressionType.impl.h" -#include "./sdk_OrthancPluginJobStopReason.impl.h" -#include "./sdk_OrthancPluginIdentifierConstraint.impl.h" -#include "./sdk_OrthancPluginContentType.impl.h" +#include "./sdk_OrthancPluginReceivedInstanceAction.impl.h" +#include "./sdk_OrthancPluginResourceType.impl.h" #include "./sdk_OrthancPluginStorageCommitmentFailureReason.impl.h" -#include "./sdk_OrthancPluginDicomToJsonFlags.impl.h" -#include "./sdk_OrthancPluginErrorCode.impl.h" -#include "./sdk_OrthancPluginCreateDicomFlags.impl.h" -#include "./sdk_OrthancPluginDicomToJsonFormat.impl.h" -#include "./sdk_OrthancPluginMetricsType.impl.h" #include "./sdk_OrthancPluginValueRepresentation.impl.h" -#include "./sdk_OrthancPluginReceivedInstanceAction.impl.h" -#include "./sdk_OrthancPluginImageFormat.impl.h" -#include "./sdk_OrthancPluginChangeType.impl.h" +#include "./sdk_OrthancPluginDicomInstance.impl.h" +#include "./sdk_OrthancPluginDicomWebNode.impl.h" +#include "./sdk_OrthancPluginFindAnswers.impl.h" +#include "./sdk_OrthancPluginFindMatcher.impl.h" +#include "./sdk_OrthancPluginFindQuery.impl.h" +#include "./sdk_OrthancPluginImage.impl.h" +#include "./sdk_OrthancPluginJob.impl.h" +#include "./sdk_OrthancPluginPeers.impl.h" #include "./sdk_OrthancPluginRestOutput.impl.h" #include "./sdk_OrthancPluginServerChunkedRequestReader.impl.h" -#include "./sdk_OrthancPluginImage.impl.h" -#include "./sdk_OrthancPluginJob.impl.h" +#include "./sdk_OrthancPluginStorageArea.impl.h" +#include "./sdk_OrthancPluginWorklistAnswers.impl.h" #include "./sdk_OrthancPluginWorklistQuery.impl.h" -#include "./sdk_OrthancPluginStorageArea.impl.h" -#include "./sdk_OrthancPluginFindMatcher.impl.h" -#include "./sdk_OrthancPluginDicomWebNode.impl.h" -#include "./sdk_OrthancPluginWorklistAnswers.impl.h" -#include "./sdk_OrthancPluginFindAnswers.impl.h" -#include "./sdk_OrthancPluginPeers.impl.h" -#include "./sdk_OrthancPluginDicomInstance.impl.h" -#include "./sdk_OrthancPluginFindQuery.impl.h" #include "./sdk_GlobalFunctions.impl.h" +#include "./sdk_OrthancPluginDicomInstance.methods.h" +#include "./sdk_OrthancPluginDicomWebNode.methods.h" +#include "./sdk_OrthancPluginFindAnswers.methods.h" +#include "./sdk_OrthancPluginFindMatcher.methods.h" +#include "./sdk_OrthancPluginFindQuery.methods.h" +#include "./sdk_OrthancPluginImage.methods.h" +#include "./sdk_OrthancPluginJob.methods.h" +#include "./sdk_OrthancPluginPeers.methods.h" +#include "./sdk_OrthancPluginRestOutput.methods.h" +#include "./sdk_OrthancPluginServerChunkedRequestReader.methods.h" +#include "./sdk_OrthancPluginStorageArea.methods.h" +#include "./sdk_OrthancPluginWorklistAnswers.methods.h" +#include "./sdk_OrthancPluginWorklistQuery.methods.h" + void RegisterOrthancSdk(PyObject* module) { + RegisterOrthancPluginChangeTypeEnumeration(module); + RegisterOrthancPluginCompressionTypeEnumeration(module); + RegisterOrthancPluginConstraintTypeEnumeration(module); + RegisterOrthancPluginContentTypeEnumeration(module); + RegisterOrthancPluginCreateDicomFlagsEnumeration(module); + RegisterOrthancPluginDicomToJsonFlagsEnumeration(module); + RegisterOrthancPluginDicomToJsonFormatEnumeration(module); + RegisterOrthancPluginDicomWebBinaryModeEnumeration(module); + RegisterOrthancPluginErrorCodeEnumeration(module); + RegisterOrthancPluginHttpMethodEnumeration(module); + RegisterOrthancPluginIdentifierConstraintEnumeration(module); + RegisterOrthancPluginImageFormatEnumeration(module); RegisterOrthancPluginInstanceOriginEnumeration(module); RegisterOrthancPluginJobStepStatusEnumeration(module); - RegisterOrthancPluginDicomWebBinaryModeEnumeration(module); - RegisterOrthancPluginHttpMethodEnumeration(module); - RegisterOrthancPluginResourceTypeEnumeration(module); - RegisterOrthancPluginConstraintTypeEnumeration(module); + RegisterOrthancPluginJobStopReasonEnumeration(module); + RegisterOrthancPluginMetricsTypeEnumeration(module); RegisterOrthancPluginPixelFormatEnumeration(module); - RegisterOrthancPluginCompressionTypeEnumeration(module); - RegisterOrthancPluginJobStopReasonEnumeration(module); - RegisterOrthancPluginIdentifierConstraintEnumeration(module); - RegisterOrthancPluginContentTypeEnumeration(module); + RegisterOrthancPluginReceivedInstanceActionEnumeration(module); + RegisterOrthancPluginResourceTypeEnumeration(module); RegisterOrthancPluginStorageCommitmentFailureReasonEnumeration(module); - RegisterOrthancPluginDicomToJsonFlagsEnumeration(module); - RegisterOrthancPluginErrorCodeEnumeration(module); - RegisterOrthancPluginCreateDicomFlagsEnumeration(module); - RegisterOrthancPluginDicomToJsonFormatEnumeration(module); - RegisterOrthancPluginMetricsTypeEnumeration(module); RegisterOrthancPluginValueRepresentationEnumeration(module); - RegisterOrthancPluginReceivedInstanceActionEnumeration(module); - RegisterOrthancPluginImageFormatEnumeration(module); - RegisterOrthancPluginChangeTypeEnumeration(module); + RegisterOrthancPluginDicomInstanceClass(module); + RegisterOrthancPluginDicomWebNodeClass(module); + RegisterOrthancPluginFindAnswersClass(module); + RegisterOrthancPluginFindMatcherClass(module); + RegisterOrthancPluginFindQueryClass(module); + RegisterOrthancPluginImageClass(module); + RegisterOrthancPluginJobClass(module); + RegisterOrthancPluginPeersClass(module); RegisterOrthancPluginRestOutputClass(module); RegisterOrthancPluginServerChunkedRequestReaderClass(module); - RegisterOrthancPluginImageClass(module); - RegisterOrthancPluginJobClass(module); + RegisterOrthancPluginStorageAreaClass(module); + RegisterOrthancPluginWorklistAnswersClass(module); RegisterOrthancPluginWorklistQueryClass(module); - RegisterOrthancPluginStorageAreaClass(module); - RegisterOrthancPluginFindMatcherClass(module); - RegisterOrthancPluginDicomWebNodeClass(module); - RegisterOrthancPluginWorklistAnswersClass(module); - RegisterOrthancPluginFindAnswersClass(module); - RegisterOrthancPluginPeersClass(module); - RegisterOrthancPluginDicomInstanceClass(module); - RegisterOrthancPluginFindQueryClass(module); }
--- a/Sources/Autogenerated/sdk.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk.h Wed Aug 30 11:52:45 2023 +0200 @@ -25,23 +25,95 @@ void RegisterOrthancSdk(PyObject* module); PyMethodDef* GetOrthancSdkFunctions(); -PyTypeObject* GetOrthancPluginRestOutputType(); -PyTypeObject* GetOrthancPluginServerChunkedRequestReaderType(); +PyTypeObject* GetOrthancPluginDicomInstanceType(); +PyTypeObject* GetOrthancPluginDicomWebNodeType(); +PyTypeObject* GetOrthancPluginFindAnswersType(); +PyTypeObject* GetOrthancPluginFindMatcherType(); +PyTypeObject* GetOrthancPluginFindQueryType(); PyTypeObject* GetOrthancPluginImageType(); PyTypeObject* GetOrthancPluginJobType(); -PyTypeObject* GetOrthancPluginWorklistQueryType(); +PyTypeObject* GetOrthancPluginPeersType(); +PyTypeObject* GetOrthancPluginRestOutputType(); +PyTypeObject* GetOrthancPluginServerChunkedRequestReaderType(); PyTypeObject* GetOrthancPluginStorageAreaType(); -PyTypeObject* GetOrthancPluginFindMatcherType(); -PyTypeObject* GetOrthancPluginDicomWebNodeType(); PyTypeObject* GetOrthancPluginWorklistAnswersType(); -PyTypeObject* GetOrthancPluginFindAnswersType(); -PyTypeObject* GetOrthancPluginPeersType(); -PyTypeObject* GetOrthancPluginDicomInstanceType(); -PyTypeObject* GetOrthancPluginFindQueryType(); +PyTypeObject* GetOrthancPluginWorklistQueryType(); #include <orthanc/OrthancCPlugin.h> -typedef struct +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginDicomInstance* object_; + bool borrowed_; +} sdk_OrthancPluginDicomInstance_Object; + +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginDicomWebNode* object_; + bool borrowed_; +} sdk_OrthancPluginDicomWebNode_Object; + +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginFindAnswers* object_; + bool borrowed_; +} sdk_OrthancPluginFindAnswers_Object; + +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginFindMatcher* object_; + bool borrowed_; +} sdk_OrthancPluginFindMatcher_Object; + +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginFindQuery* object_; + bool borrowed_; +} sdk_OrthancPluginFindQuery_Object; + +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginImage* object_; + bool borrowed_; +} sdk_OrthancPluginImage_Object; + +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginJob* object_; + bool borrowed_; +} sdk_OrthancPluginJob_Object; + +typedef struct +{ + PyObject_HEAD + + /* Type-specific fields go here. */ + OrthancPluginPeers* object_; + bool borrowed_; +} sdk_OrthancPluginPeers_Object; + +typedef struct { PyObject_HEAD @@ -50,7 +122,7 @@ bool borrowed_; } sdk_OrthancPluginRestOutput_Object; -typedef struct +typedef struct { PyObject_HEAD @@ -59,25 +131,25 @@ bool borrowed_; } sdk_OrthancPluginServerChunkedRequestReader_Object; -typedef struct +typedef struct { PyObject_HEAD /* Type-specific fields go here. */ - OrthancPluginImage* object_; + OrthancPluginStorageArea* object_; bool borrowed_; -} sdk_OrthancPluginImage_Object; +} sdk_OrthancPluginStorageArea_Object; -typedef struct +typedef struct { PyObject_HEAD /* Type-specific fields go here. */ - OrthancPluginJob* object_; + OrthancPluginWorklistAnswers* object_; bool borrowed_; -} sdk_OrthancPluginJob_Object; +} sdk_OrthancPluginWorklistAnswers_Object; -typedef struct +typedef struct { PyObject_HEAD @@ -86,75 +158,3 @@ bool borrowed_; } sdk_OrthancPluginWorklistQuery_Object; -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginStorageArea* object_; - bool borrowed_; -} sdk_OrthancPluginStorageArea_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginFindMatcher* object_; - bool borrowed_; -} sdk_OrthancPluginFindMatcher_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginDicomWebNode* object_; - bool borrowed_; -} sdk_OrthancPluginDicomWebNode_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginWorklistAnswers* object_; - bool borrowed_; -} sdk_OrthancPluginWorklistAnswers_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginFindAnswers* object_; - bool borrowed_; -} sdk_OrthancPluginFindAnswers_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginPeers* object_; - bool borrowed_; -} sdk_OrthancPluginPeers_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginDicomInstance* object_; - bool borrowed_; -} sdk_OrthancPluginDicomInstance_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginFindQuery* object_; - bool borrowed_; -} sdk_OrthancPluginFindQuery_Object; -
--- a/Sources/Autogenerated/sdk_OrthancPluginChangeType.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginChangeType.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,25 +64,120 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "COMPLETED_SERIES", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "DELETED", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_CHILD_INSTANCE", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_INSTANCE", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_PATIENT", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_SERIES", PyLong_FromLong(5)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_STUDY", PyLong_FromLong(6)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_PATIENT", PyLong_FromLong(7)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_SERIES", PyLong_FromLong(8)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_STUDY", PyLong_FromLong(9)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "ORTHANC_STARTED", PyLong_FromLong(10)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "ORTHANC_STOPPED", PyLong_FromLong(11)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_ATTACHMENT", PyLong_FromLong(12)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_METADATA", PyLong_FromLong(13)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_PEERS", PyLong_FromLong(14)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_MODALITIES", PyLong_FromLong(15)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_SUBMITTED", PyLong_FromLong(16)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_SUCCESS", PyLong_FromLong(17)); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_FAILURE", PyLong_FromLong(18)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "COMPLETED_SERIES", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "DELETED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_CHILD_INSTANCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_INSTANCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_PATIENT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(5); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_SERIES", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(6); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_STUDY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(7); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_PATIENT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(8); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_SERIES", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(9); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_STUDY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(10); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "ORTHANC_STARTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(11); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "ORTHANC_STOPPED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(12); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_ATTACHMENT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(13); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_METADATA", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(14); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_PEERS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(15); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_MODALITIES", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(16); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_SUBMITTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(17); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_SUCCESS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(18); + PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_FAILURE", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginChangeType_Type); if (PyModule_AddObject(module, "ChangeType", (PyObject *)&sdk_OrthancPluginChangeType_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginCompressionType.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginCompressionType.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,10 +64,30 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "ZLIB", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "ZLIB_WITH_SIZE", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "GZIP", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "GZIP_WITH_SIZE", PyLong_FromLong(3)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "ZLIB", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "ZLIB_WITH_SIZE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "GZIP", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "GZIP_WITH_SIZE", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginCompressionType_Type); if (PyModule_AddObject(module, "CompressionType", (PyObject *)&sdk_OrthancPluginCompressionType_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginConstraintType.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginConstraintType.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,11 +64,36 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "EQUAL", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "SMALLER_OR_EQUAL", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "GREATER_OR_EQUAL", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "WILDCARD", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "LIST", PyLong_FromLong(5)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "EQUAL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "SMALLER_OR_EQUAL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "GREATER_OR_EQUAL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "WILDCARD", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(5); + PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "LIST", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginConstraintType_Type); if (PyModule_AddObject(module, "ConstraintType", (PyObject *)&sdk_OrthancPluginConstraintType_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginContentType.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginContentType.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,10 +64,30 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "UNKNOWN", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM_AS_JSON", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM_UNTIL_PIXEL_DATA", PyLong_FromLong(3)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "UNKNOWN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM_AS_JSON", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM_UNTIL_PIXEL_DATA", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginContentType_Type); if (PyModule_AddObject(module, "ContentType", (PyObject *)&sdk_OrthancPluginContentType_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginCreateDicomFlags.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginCreateDicomFlags.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,9 +64,24 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "NONE", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "DECODE_DATA_URI_SCHEME", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "GENERATE_IDENTIFIERS", PyLong_FromLong(2)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "NONE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "DECODE_DATA_URI_SCHEME", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "GENERATE_IDENTIFIERS", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginCreateDicomFlags_Type); if (PyModule_AddObject(module, "CreateDicomFlags", (PyObject *)&sdk_OrthancPluginCreateDicomFlags_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomInstance.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginDicomInstance.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -160,361 +160,6 @@ } -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRemoteAet( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceRemoteAet() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - const char* s = OrthancPluginGetInstanceRemoteAet(OrthancPlugins::GetGlobalContext(), self->object_); - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSize( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceSize() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginGetInstanceSize(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceJson() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPlugins::OrthancString s; - s.Assign(OrthancPluginGetInstanceJson(OrthancPlugins::GetGlobalContext(), self->object_)); - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSimplifiedJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceSimplifiedJson() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPlugins::OrthancString s; - s.Assign(OrthancPluginGetInstanceSimplifiedJson(OrthancPlugins::GetGlobalContext(), self->object_)); - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstanceMetadata( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginHasInstanceMetadata() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - long value = OrthancPluginHasInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceMetadata( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceMetadata() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - const char* s = OrthancPluginGetInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceOrigin( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceOrigin() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPluginInstanceOrigin value = OrthancPluginGetInstanceOrigin(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceTransferSyntaxUid( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceTransferSyntaxUid() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPlugins::OrthancString s; - s.Assign(OrthancPluginGetInstanceTransferSyntaxUid(OrthancPlugins::GetGlobalContext(), self->object_)); - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstancePixelData( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginHasInstancePixelData() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginHasInstancePixelData(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceFramesCount( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceFramesCount() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginGetInstanceFramesCount(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRawFrame( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceRawFrame() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code = OrthancPluginGetInstanceRawFrame(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0); - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceDecodedFrame( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceDecodedFrame() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - // This is the case of a constructor - OrthancPluginImage* obj = OrthancPluginGetInstanceDecodedFrame(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginSerializeDicomInstance( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSerializeDicomInstance() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code = OrthancPluginSerializeDicomInstance(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceAdvancedJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceAdvancedJson() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - long int arg1 = 0; - unsigned long arg2 = 0; - - if (!PyArg_ParseTuple(args, "llk", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - OrthancPlugins::OrthancString s; - s.Assign(OrthancPluginGetInstanceAdvancedJson(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginDicomToJsonFormat>(arg0), static_cast<OrthancPluginDicomToJsonFlags>(arg1), arg2)); - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - - - static void RegisterOrthancPluginDicomInstanceClass(PyObject* module) { sdk_OrthancPluginDicomInstance_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginDicomInstance.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,353 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRemoteAet( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceRemoteAet() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + const char* s = OrthancPluginGetInstanceRemoteAet(OrthancPlugins::GetGlobalContext(), self->object_); + + if (s == NULL) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + return PyUnicode_FromString(s); + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSize( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceSize() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginGetInstanceSize(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceJson( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceJson() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPlugins::OrthancString s; + s.Assign(OrthancPluginGetInstanceJson(OrthancPlugins::GetGlobalContext(), self->object_)); + + if (s.GetContent() == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + return PyUnicode_FromString(s.GetContent()); + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSimplifiedJson( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceSimplifiedJson() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPlugins::OrthancString s; + s.Assign(OrthancPluginGetInstanceSimplifiedJson(OrthancPlugins::GetGlobalContext(), self->object_)); + + if (s.GetContent() == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + return PyUnicode_FromString(s.GetContent()); + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstanceMetadata( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginHasInstanceMetadata() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + + if (!PyArg_ParseTuple(args, "s", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + long value = OrthancPluginHasInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceMetadata( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceMetadata() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + + if (!PyArg_ParseTuple(args, "s", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + const char* s = OrthancPluginGetInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + if (s == NULL) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + return PyUnicode_FromString(s); + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceOrigin( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceOrigin() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPluginInstanceOrigin value = OrthancPluginGetInstanceOrigin(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceTransferSyntaxUid( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceTransferSyntaxUid() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPlugins::OrthancString s; + s.Assign(OrthancPluginGetInstanceTransferSyntaxUid(OrthancPlugins::GetGlobalContext(), self->object_)); + + if (s.GetContent() == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + return PyUnicode_FromString(s.GetContent()); + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstancePixelData( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginHasInstancePixelData() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginHasInstancePixelData(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceFramesCount( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceFramesCount() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginGetInstanceFramesCount(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRawFrame( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceRawFrame() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + + if (!PyArg_ParseTuple(args, "k", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPlugins::MemoryBuffer buffer; + OrthancPluginErrorCode code = OrthancPluginGetInstanceRawFrame(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0); + + if (code == OrthancPluginErrorCode_Success) + { + return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceDecodedFrame( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceDecodedFrame() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + + if (!PyArg_ParseTuple(args, "k", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + // This is the case of a constructor + OrthancPluginImage* obj = OrthancPluginGetInstanceDecodedFrame(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + if (obj == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); + PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); + Py_DECREF(argList); + return python; + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginSerializeDicomInstance( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSerializeDicomInstance() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPlugins::MemoryBuffer buffer; + OrthancPluginErrorCode code = OrthancPluginSerializeDicomInstance(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); + + if (code == OrthancPluginErrorCode_Success) + { + return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceAdvancedJson( + sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetInstanceAdvancedJson() on object of class OrthancPluginDicomInstance"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + long int arg0 = 0; + long int arg1 = 0; + unsigned long arg2 = 0; + + if (!PyArg_ParseTuple(args, "llk", &arg0, &arg1, &arg2)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); + return NULL; + } + OrthancPlugins::OrthancString s; + s.Assign(OrthancPluginGetInstanceAdvancedJson(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginDicomToJsonFormat>(arg0), static_cast<OrthancPluginDicomToJsonFlags>(arg1), arg2)); + + if (s.GetContent() == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + return PyUnicode_FromString(s.GetContent()); + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFlags.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFlags.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,15 +64,60 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "NONE", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_BINARY", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_PRIVATE_TAGS", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_UNKNOWN_TAGS", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_PIXEL_DATA", PyLong_FromLong(8)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "CONVERT_BINARY_TO_ASCII", PyLong_FromLong(16)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "CONVERT_BINARY_TO_NULL", PyLong_FromLong(32)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "STOP_AFTER_PIXEL_DATA", PyLong_FromLong(64)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "SKIP_GROUP_LENGTHS", PyLong_FromLong(128)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "NONE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_BINARY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_PRIVATE_TAGS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_UNKNOWN_TAGS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(8); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_PIXEL_DATA", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(16); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "CONVERT_BINARY_TO_ASCII", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(32); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "CONVERT_BINARY_TO_NULL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(64); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "STOP_AFTER_PIXEL_DATA", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(128); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "SKIP_GROUP_LENGTHS", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginDicomToJsonFlags_Type); if (PyModule_AddObject(module, "DicomToJsonFlags", (PyObject *)&sdk_OrthancPluginDicomToJsonFlags_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFormat.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFormat.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,9 +64,24 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "FULL", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "SHORT", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "HUMAN", PyLong_FromLong(3)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "FULL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "SHORT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "HUMAN", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginDicomToJsonFormat_Type); if (PyModule_AddObject(module, "DicomToJsonFormat", (PyObject *)&sdk_OrthancPluginDicomToJsonFormat_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomWebBinaryMode.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginDicomWebBinaryMode.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,9 +64,24 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "IGNORE", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "INLINE_BINARY", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "BULK_DATA_URI", PyLong_FromLong(2)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "IGNORE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "INLINE_BINARY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "BULK_DATA_URI", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginDicomWebBinaryMode_Type); if (PyModule_AddObject(module, "DicomWebBinaryMode", (PyObject *)&sdk_OrthancPluginDicomWebBinaryMode_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomWebNode.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginDicomWebNode.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -70,9 +70,6 @@ -// Actual implementation of the methods - - static void RegisterOrthancPluginDicomWebNodeClass(PyObject* module) { sdk_OrthancPluginDicomWebNode_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginDicomWebNode.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,1 @@ +// Actual implementation of the methods
--- a/Sources/Autogenerated/sdk_OrthancPluginErrorCode.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginErrorCode.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,113 +64,648 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INTERNAL_ERROR", PyLong_FromLong(-1)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SUCCESS", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PLUGIN", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_IMPLEMENTED", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PARAMETER_OUT_OF_RANGE", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_ENOUGH_MEMORY", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_PARAMETER_TYPE", PyLong_FromLong(5)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_SEQUENCE_OF_CALLS", PyLong_FromLong(6)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_ITEM", PyLong_FromLong(7)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_REQUEST", PyLong_FromLong(8)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NETWORK_PROTOCOL", PyLong_FromLong(9)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SYSTEM_COMMAND", PyLong_FromLong(10)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE", PyLong_FromLong(11)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "URI_SYNTAX", PyLong_FromLong(12)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_FILE", PyLong_FromLong(13)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_WRITE_FILE", PyLong_FromLong(14)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_FILE_FORMAT", PyLong_FromLong(15)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "TIMEOUT", PyLong_FromLong(16)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_RESOURCE", PyLong_FromLong(17)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_DATABASE_VERSION", PyLong_FromLong(18)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "FULL_STORAGE", PyLong_FromLong(19)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CORRUPTED_FILE", PyLong_FromLong(20)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_TAG", PyLong_FromLong(21)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "READ_ONLY", PyLong_FromLong(22)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_IMAGE_FORMAT", PyLong_FromLong(23)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_IMAGE_SIZE", PyLong_FromLong(24)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SHARED_LIBRARY", PyLong_FromLong(25)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_PLUGIN_SERVICE", PyLong_FromLong(26)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_DICOM_TAG", PyLong_FromLong(27)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_JSON", PyLong_FromLong(28)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNAUTHORIZED", PyLong_FromLong(29)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_FONT", PyLong_FromLong(30)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_PLUGIN", PyLong_FromLong(31)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "STORAGE_AREA_PLUGIN", PyLong_FromLong(32)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "EMPTY_REQUEST", PyLong_FromLong(33)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_ACCEPTABLE", PyLong_FromLong(34)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NULL_POINTER", PyLong_FromLong(35)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_UNAVAILABLE", PyLong_FromLong(36)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANCELED_JOB", PyLong_FromLong(37)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_GEOMETRY", PyLong_FromLong(38)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SSL_INITIALIZATION", PyLong_FromLong(39)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DISCONTINUED_ABI", PyLong_FromLong(40)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_RANGE", PyLong_FromLong(41)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_CANNOT_SERIALIZE", PyLong_FromLong(42)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "REVISION", PyLong_FromLong(43)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_NOT_OPENED", PyLong_FromLong(1000)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_ALREADY_OPENED", PyLong_FromLong(1001)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_OPEN", PyLong_FromLong(1002)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_STATEMENT_ALREADY_USED", PyLong_FromLong(1003)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_EXECUTE", PyLong_FromLong(1004)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_ROLLBACK_WITHOUT_TRANSACTION", PyLong_FromLong(1005)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_COMMIT_WITHOUT_TRANSACTION", PyLong_FromLong(1006)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_REGISTER_FUNCTION", PyLong_FromLong(1007)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_FLUSH", PyLong_FromLong(1008)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_RUN", PyLong_FromLong(1009)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_STEP", PyLong_FromLong(1010)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_BIND_OUT_OF_RANGE", PyLong_FromLong(1011)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_PREPARE_STATEMENT", PyLong_FromLong(1012)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_ALREADY_STARTED", PyLong_FromLong(1013)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_COMMIT", PyLong_FromLong(1014)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_BEGIN", PyLong_FromLong(1015)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DIRECTORY_OVER_FILE", PyLong_FromLong(2000)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "FILE_STORAGE_CANNOT_WRITE", PyLong_FromLong(2001)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DIRECTORY_EXPECTED", PyLong_FromLong(2002)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "HTTP_PORT_IN_USE", PyLong_FromLong(2003)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_PORT_IN_USE", PyLong_FromLong(2004)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_HTTP_STATUS_IN_REST", PyLong_FromLong(2005)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "REGULAR_FILE_EXPECTED", PyLong_FromLong(2006)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PATH_TO_EXECUTABLE", PyLong_FromLong(2007)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "MAKE_DIRECTORY", PyLong_FromLong(2008)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_APPLICATION_ENTITY_TITLE", PyLong_FromLong(2009)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CFIND_HANDLER", PyLong_FromLong(2010)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CMOVE_HANDLER", PyLong_FromLong(2011)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CSTORE_HANDLER", PyLong_FromLong(2012)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_APPLICATION_ENTITY_FILTER", PyLong_FromLong(2013)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_SOP_CLASS_OR_INSTANCE", PyLong_FromLong(2014)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_PRESENTATION_CONTEXT", PyLong_FromLong(2015)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_FIND_UNAVAILABLE", PyLong_FromLong(2016)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_MOVE_UNAVAILABLE", PyLong_FromLong(2017)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_STORE_INSTANCE", PyLong_FromLong(2018)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_NOT_STRING", PyLong_FromLong(2019)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_OVERRIDE_TAG", PyLong_FromLong(2020)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_USE_CONTENT", PyLong_FromLong(2021)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_NO_PAYLOAD", PyLong_FromLong(2022)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_USE_DATA_URI_SCHEME", PyLong_FromLong(2023)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_BAD_PARENT", PyLong_FromLong(2024)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_PARENT_IS_INSTANCE", PyLong_FromLong(2025)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_PARENT_ENCODING", PyLong_FromLong(2026)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_MODALITY", PyLong_FromLong(2027)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_JOB_ORDERING", PyLong_FromLong(2028)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "JSON_TO_LUA_TABLE", PyLong_FromLong(2029)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_CREATE_LUA", PyLong_FromLong(2030)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_EXECUTE_LUA", PyLong_FromLong(2031)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_ALREADY_EXECUTED", PyLong_FromLong(2032)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_BAD_OUTPUT", PyLong_FromLong(2033)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_LUA_PREDICATE", PyLong_FromLong(2034)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_RETURNS_NO_STRING", PyLong_FromLong(2035)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "STORAGE_AREA_ALREADY_REGISTERED", PyLong_FromLong(2036)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_BACKEND_ALREADY_REGISTERED", PyLong_FromLong(2037)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_NOT_INITIALIZED", PyLong_FromLong(2038)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SSL_DISABLED", PyLong_FromLong(2039)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_ORDER_SLICES", PyLong_FromLong(2040)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_WORKLIST_HANDLER", PyLong_FromLong(2041)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "ALREADY_EXISTING_TAG", PyLong_FromLong(2042)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_STORAGE_COMMITMENT_HANDLER", PyLong_FromLong(2043)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CGET_HANDLER", PyLong_FromLong(2044)); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNSUPPORTED_MEDIA_TYPE", PyLong_FromLong(3000)); + { + PyObject* tmp = PyLong_FromLong(-1); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INTERNAL_ERROR", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SUCCESS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PLUGIN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_IMPLEMENTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PARAMETER_OUT_OF_RANGE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_ENOUGH_MEMORY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(5); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_PARAMETER_TYPE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(6); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_SEQUENCE_OF_CALLS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(7); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_ITEM", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(8); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_REQUEST", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(9); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NETWORK_PROTOCOL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(10); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SYSTEM_COMMAND", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(11); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(12); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "URI_SYNTAX", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(13); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_FILE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(14); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_WRITE_FILE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(15); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_FILE_FORMAT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(16); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "TIMEOUT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(17); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_RESOURCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(18); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_DATABASE_VERSION", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(19); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "FULL_STORAGE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(20); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CORRUPTED_FILE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(21); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_TAG", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(22); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "READ_ONLY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(23); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_IMAGE_FORMAT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(24); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_IMAGE_SIZE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(25); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SHARED_LIBRARY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(26); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_PLUGIN_SERVICE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(27); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_DICOM_TAG", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(28); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_JSON", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(29); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNAUTHORIZED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(30); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_FONT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(31); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_PLUGIN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(32); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "STORAGE_AREA_PLUGIN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(33); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "EMPTY_REQUEST", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(34); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_ACCEPTABLE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(35); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NULL_POINTER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(36); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_UNAVAILABLE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(37); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANCELED_JOB", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(38); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_GEOMETRY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(39); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SSL_INITIALIZATION", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(40); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DISCONTINUED_ABI", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(41); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_RANGE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(42); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_CANNOT_SERIALIZE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(43); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "REVISION", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1000); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_NOT_OPENED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1001); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_ALREADY_OPENED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1002); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_OPEN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1003); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_STATEMENT_ALREADY_USED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1004); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_EXECUTE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1005); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_ROLLBACK_WITHOUT_TRANSACTION", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1006); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_COMMIT_WITHOUT_TRANSACTION", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1007); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_REGISTER_FUNCTION", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1008); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_FLUSH", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1009); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_RUN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1010); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_STEP", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1011); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_BIND_OUT_OF_RANGE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1012); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_PREPARE_STATEMENT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1013); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_ALREADY_STARTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1014); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_COMMIT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1015); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_BEGIN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2000); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DIRECTORY_OVER_FILE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2001); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "FILE_STORAGE_CANNOT_WRITE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2002); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DIRECTORY_EXPECTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2003); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "HTTP_PORT_IN_USE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2004); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_PORT_IN_USE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2005); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_HTTP_STATUS_IN_REST", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2006); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "REGULAR_FILE_EXPECTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2007); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PATH_TO_EXECUTABLE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2008); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "MAKE_DIRECTORY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2009); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_APPLICATION_ENTITY_TITLE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2010); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CFIND_HANDLER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2011); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CMOVE_HANDLER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2012); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CSTORE_HANDLER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2013); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_APPLICATION_ENTITY_FILTER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2014); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_SOP_CLASS_OR_INSTANCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2015); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_PRESENTATION_CONTEXT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2016); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_FIND_UNAVAILABLE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2017); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_MOVE_UNAVAILABLE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2018); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_STORE_INSTANCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2019); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_NOT_STRING", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2020); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_OVERRIDE_TAG", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2021); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_USE_CONTENT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2022); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_NO_PAYLOAD", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2023); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_USE_DATA_URI_SCHEME", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2024); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_BAD_PARENT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2025); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_PARENT_IS_INSTANCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2026); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_PARENT_ENCODING", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2027); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_MODALITY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2028); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_JOB_ORDERING", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2029); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "JSON_TO_LUA_TABLE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2030); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_CREATE_LUA", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2031); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_EXECUTE_LUA", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2032); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_ALREADY_EXECUTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2033); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_BAD_OUTPUT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2034); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_LUA_PREDICATE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2035); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_RETURNS_NO_STRING", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2036); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "STORAGE_AREA_ALREADY_REGISTERED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2037); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_BACKEND_ALREADY_REGISTERED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2038); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_NOT_INITIALIZED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2039); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SSL_DISABLED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2040); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_ORDER_SLICES", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2041); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_WORKLIST_HANDLER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2042); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "ALREADY_EXISTING_TAG", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2043); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_STORAGE_COMMITMENT_HANDLER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2044); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CGET_HANDLER", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3000); + PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNSUPPORTED_MEDIA_TYPE", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginErrorCode_Type); if (PyModule_AddObject(module, "ErrorCode", (PyObject *)&sdk_OrthancPluginErrorCode_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginFindAnswers.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginFindAnswers.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -80,69 +80,6 @@ -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindAddAnswer( - sdk_OrthancPluginFindAnswers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginFindAddAnswer() on object of class OrthancPluginFindAnswers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "s*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPluginErrorCode code = OrthancPluginFindAddAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); - PyBuffer_Release(&arg0); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindMarkIncomplete( - sdk_OrthancPluginFindAnswers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginFindMarkIncomplete() on object of class OrthancPluginFindAnswers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPluginErrorCode code = OrthancPluginFindMarkIncomplete(OrthancPlugins::GetGlobalContext(), self->object_); - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - - - static void RegisterOrthancPluginFindAnswersClass(PyObject* module) { sdk_OrthancPluginFindAnswers_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginFindAnswers.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,61 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindAddAnswer( + sdk_OrthancPluginFindAnswers_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginFindAddAnswer() on object of class OrthancPluginFindAnswers"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + Py_buffer arg0; + + if (!PyArg_ParseTuple(args, "s*", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPluginErrorCode code = OrthancPluginFindAddAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); + PyBuffer_Release(&arg0); + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindMarkIncomplete( + sdk_OrthancPluginFindAnswers_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginFindMarkIncomplete() on object of class OrthancPluginFindAnswers"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPluginErrorCode code = OrthancPluginFindMarkIncomplete(OrthancPlugins::GetGlobalContext(), self->object_); + + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginFindMatcher.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginFindMatcher.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -90,32 +90,6 @@ } -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginFindMatcher_OrthancPluginFindMatcherIsMatch( - sdk_OrthancPluginFindMatcher_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginFindMatcherIsMatch() on object of class OrthancPluginFindMatcher"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "s*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - long value = OrthancPluginFindMatcherIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); - PyBuffer_Release(&arg0); - return PyLong_FromLong(value); -} - - - static void RegisterOrthancPluginFindMatcherClass(PyObject* module) { sdk_OrthancPluginFindMatcher_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginFindMatcher.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,24 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginFindMatcher_OrthancPluginFindMatcherIsMatch( + sdk_OrthancPluginFindMatcher_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginFindMatcherIsMatch() on object of class OrthancPluginFindMatcher"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + Py_buffer arg0; + + if (!PyArg_ParseTuple(args, "s*", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + long value = OrthancPluginFindMatcherIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); + PyBuffer_Release(&arg0); + return PyLong_FromLong(value); +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginFindQuery.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginFindQuery.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -95,90 +95,6 @@ -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQuerySize( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetFindQuerySize() on object of class OrthancPluginFindQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginGetFindQuerySize(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryTagName( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetFindQueryTagName() on object of class OrthancPluginFindQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPlugins::OrthancString s; - s.Assign(OrthancPluginGetFindQueryTagName(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryValue( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetFindQueryValue() on object of class OrthancPluginFindQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPlugins::OrthancString s; - s.Assign(OrthancPluginGetFindQueryValue(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - - - static void RegisterOrthancPluginFindQueryClass(PyObject* module) { sdk_OrthancPluginFindQuery_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginFindQuery.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,82 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQuerySize( + sdk_OrthancPluginFindQuery_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetFindQuerySize() on object of class OrthancPluginFindQuery"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginGetFindQuerySize(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryTagName( + sdk_OrthancPluginFindQuery_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetFindQueryTagName() on object of class OrthancPluginFindQuery"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + + if (!PyArg_ParseTuple(args, "k", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPlugins::OrthancString s; + s.Assign(OrthancPluginGetFindQueryTagName(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); + + if (s.GetContent() == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + return PyUnicode_FromString(s.GetContent()); + } +} + +static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryValue( + sdk_OrthancPluginFindQuery_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetFindQueryValue() on object of class OrthancPluginFindQuery"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + + if (!PyArg_ParseTuple(args, "k", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPlugins::OrthancString s; + s.Assign(OrthancPluginGetFindQueryValue(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); + + if (s.GetContent() == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + return PyUnicode_FromString(s.GetContent()); + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginHttpMethod.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginHttpMethod.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,10 +64,30 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "GET", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "POST", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "PUT", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "DELETE", PyLong_FromLong(4)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "GET", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "POST", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "PUT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "DELETE", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginHttpMethod_Type); if (PyModule_AddObject(module, "HttpMethod", (PyObject *)&sdk_OrthancPluginHttpMethod_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginIdentifierConstraint.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginIdentifierConstraint.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,10 +64,30 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "EQUAL", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "SMALLER_OR_EQUAL", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "GREATER_OR_EQUAL", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "WILDCARD", PyLong_FromLong(4)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "EQUAL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "SMALLER_OR_EQUAL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "GREATER_OR_EQUAL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "WILDCARD", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginIdentifierConstraint_Type); if (PyModule_AddObject(module, "IdentifierConstraint", (PyObject *)&sdk_OrthancPluginIdentifierConstraint_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginImage.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginImage.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -120,151 +120,6 @@ } -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImagePixelFormat() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPluginPixelFormat value = OrthancPluginGetImagePixelFormat(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImageWidth() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginGetImageWidth(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImageHeight() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginGetImageHeight(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImagePitch() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginGetImagePitch(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginConvertPixelFormat() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - - if (!PyArg_ParseTuple(args, "l", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - // This is the case of a constructor - OrthancPluginImage* obj = OrthancPluginConvertPixelFormat(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0)); - - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginDrawText() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - const char* arg1 = NULL; - long int arg2 = 0; - long int arg3 = 0; - unsigned char arg4 = 0; - unsigned char arg5 = 0; - unsigned char arg6 = 0; - - if (!PyArg_ParseTuple(args, "ksllbbb", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)"); - return NULL; - } - OrthancPluginErrorCode code = OrthancPluginDrawText(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - - - static void RegisterOrthancPluginImageClass(PyObject* module) { sdk_OrthancPluginImage_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginImage.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,143 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat( + sdk_OrthancPluginImage_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetImagePixelFormat() on object of class OrthancPluginImage"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPluginPixelFormat value = OrthancPluginGetImagePixelFormat(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth( + sdk_OrthancPluginImage_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetImageWidth() on object of class OrthancPluginImage"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginGetImageWidth(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight( + sdk_OrthancPluginImage_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetImageHeight() on object of class OrthancPluginImage"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginGetImageHeight(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch( + sdk_OrthancPluginImage_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetImagePitch() on object of class OrthancPluginImage"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginGetImagePitch(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat( + sdk_OrthancPluginImage_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginConvertPixelFormat() on object of class OrthancPluginImage"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + long int arg0 = 0; + + if (!PyArg_ParseTuple(args, "l", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + // This is the case of a constructor + OrthancPluginImage* obj = OrthancPluginConvertPixelFormat(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0)); + + if (obj == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); + PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); + Py_DECREF(argList); + return python; + } +} + +static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText( + sdk_OrthancPluginImage_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginDrawText() on object of class OrthancPluginImage"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + const char* arg1 = NULL; + long int arg2 = 0; + long int arg3 = 0; + unsigned char arg4 = 0; + unsigned char arg5 = 0; + unsigned char arg6 = 0; + + if (!PyArg_ParseTuple(args, "ksllbbb", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)"); + return NULL; + } + OrthancPluginErrorCode code = OrthancPluginDrawText(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); + + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginImageFormat.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginImageFormat.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,9 +64,24 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "PNG", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "JPEG", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "DICOM", PyLong_FromLong(2)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "PNG", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "JPEG", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "DICOM", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginImageFormat_Type); if (PyModule_AddObject(module, "ImageFormat", (PyObject *)&sdk_OrthancPluginImageFormat_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginInstanceOrigin.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginInstanceOrigin.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,12 +64,42 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "UNKNOWN", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "DICOM_PROTOCOL", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "REST_API", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "PLUGIN", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "LUA", PyLong_FromLong(5)); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "WEB_DAV", PyLong_FromLong(6)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "UNKNOWN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "DICOM_PROTOCOL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "REST_API", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "PLUGIN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(5); + PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "LUA", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(6); + PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "WEB_DAV", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginInstanceOrigin_Type); if (PyModule_AddObject(module, "InstanceOrigin", (PyObject *)&sdk_OrthancPluginInstanceOrigin_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginJob.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginJob.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -90,41 +90,6 @@ } -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginJob_OrthancPluginSubmitJob( - sdk_OrthancPluginJob_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSubmitJob() on object of class OrthancPluginJob"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - int arg0 = 0; - - if (!PyArg_ParseTuple(args, "i", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPlugins::OrthancString s; - s.Assign(OrthancPluginSubmitJob(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - - - static void RegisterOrthancPluginJobClass(PyObject* module) { sdk_OrthancPluginJob_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginJob.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,33 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginJob_OrthancPluginSubmitJob( + sdk_OrthancPluginJob_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSubmitJob() on object of class OrthancPluginJob"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + int arg0 = 0; + + if (!PyArg_ParseTuple(args, "i", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPlugins::OrthancString s; + s.Assign(OrthancPluginSubmitJob(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); + + if (s.GetContent() == NULL) + { + PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); + return NULL; + } + else + { + return PyUnicode_FromString(s.GetContent()); + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginJobStepStatus.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginJobStepStatus.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,9 +64,24 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "SUCCESS", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "FAILURE", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "CONTINUE", PyLong_FromLong(3)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "SUCCESS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "FAILURE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "CONTINUE", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginJobStepStatus_Type); if (PyModule_AddObject(module, "JobStepStatus", (PyObject *)&sdk_OrthancPluginJobStepStatus_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginJobStopReason.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginJobStopReason.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,10 +64,30 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "SUCCESS", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "PAUSED", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "FAILURE", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "CANCELED", PyLong_FromLong(4)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "SUCCESS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "PAUSED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "FAILURE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "CANCELED", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginJobStopReason_Type); if (PyModule_AddObject(module, "JobStopReason", (PyObject *)&sdk_OrthancPluginJobStopReason_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginMetricsType.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginMetricsType.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,8 +64,18 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginMetricsType_Type.tp_dict, "DEFAULT", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginMetricsType_Type.tp_dict, "TIMER", PyLong_FromLong(1)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginMetricsType_Type.tp_dict, "DEFAULT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginMetricsType_Type.tp_dict, "TIMER", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginMetricsType_Type); if (PyModule_AddObject(module, "MetricsType", (PyObject *)&sdk_OrthancPluginMetricsType_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginPeers.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginPeers.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -105,120 +105,6 @@ } -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeersCount( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeersCount() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - long value = OrthancPluginGetPeersCount(OrthancPlugins::GetGlobalContext(), self->object_); - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerName( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeerName() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - const char* s = OrthancPluginGetPeerName(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUrl( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeerUrl() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - const char* s = OrthancPluginGetPeerUrl(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUserProperty( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeerUserProperty() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ks", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - const char* s = OrthancPluginGetPeerUserProperty(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - - - static void RegisterOrthancPluginPeersClass(PyObject* module) { sdk_OrthancPluginPeers_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginPeers.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,112 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeersCount( + sdk_OrthancPluginPeers_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetPeersCount() on object of class OrthancPluginPeers"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + long value = OrthancPluginGetPeersCount(OrthancPlugins::GetGlobalContext(), self->object_); + + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerName( + sdk_OrthancPluginPeers_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetPeerName() on object of class OrthancPluginPeers"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + + if (!PyArg_ParseTuple(args, "k", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + const char* s = OrthancPluginGetPeerName(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + if (s == NULL) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + return PyUnicode_FromString(s); + } +} + +static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUrl( + sdk_OrthancPluginPeers_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetPeerUrl() on object of class OrthancPluginPeers"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + + if (!PyArg_ParseTuple(args, "k", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + const char* s = OrthancPluginGetPeerUrl(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + if (s == NULL) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + return PyUnicode_FromString(s); + } +} + +static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUserProperty( + sdk_OrthancPluginPeers_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginGetPeerUserProperty() on object of class OrthancPluginPeers"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned long arg0 = 0; + const char* arg1 = NULL; + + if (!PyArg_ParseTuple(args, "ks", &arg0, &arg1)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + const char* s = OrthancPluginGetPeerUserProperty(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); + + if (s == NULL) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + return PyUnicode_FromString(s); + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginPixelFormat.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginPixelFormat.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,17 +64,72 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE8", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE16", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "SIGNED_GRAYSCALE16", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGB24", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGBA32", PyLong_FromLong(5)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "UNKNOWN", PyLong_FromLong(6)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGB48", PyLong_FromLong(7)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE32", PyLong_FromLong(8)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "FLOAT32", PyLong_FromLong(9)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "BGRA32", PyLong_FromLong(10)); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE64", PyLong_FromLong(11)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE8", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE16", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "SIGNED_GRAYSCALE16", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGB24", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(5); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGBA32", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(6); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "UNKNOWN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(7); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGB48", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(8); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE32", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(9); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "FLOAT32", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(10); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "BGRA32", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(11); + PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE64", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginPixelFormat_Type); if (PyModule_AddObject(module, "PixelFormat", (PyObject *)&sdk_OrthancPluginPixelFormat_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginReceivedInstanceAction.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginReceivedInstanceAction.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,9 +64,24 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "KEEP_AS_IS", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "MODIFY", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "DISCARD", PyLong_FromLong(3)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "KEEP_AS_IS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "MODIFY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "DISCARD", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginReceivedInstanceAction_Type); if (PyModule_AddObject(module, "ReceivedInstanceAction", (PyObject *)&sdk_OrthancPluginReceivedInstanceAction_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginResourceType.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginResourceType.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,11 +64,36 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "PATIENT", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "STUDY", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "SERIES", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "INSTANCE", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "NONE", PyLong_FromLong(4)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "PATIENT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "STUDY", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "SERIES", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "INSTANCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "NONE", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginResourceType_Type); if (PyModule_AddObject(module, "ResourceType", (PyObject *)&sdk_OrthancPluginResourceType_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginRestOutput.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginRestOutput.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -135,366 +135,6 @@ -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginAnswerBuffer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginAnswerBuffer() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - const char* arg2 = NULL; - - if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len, arg2); - PyBuffer_Release(&arg0); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerPngImage( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerPngImage() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - unsigned long arg1 = 0; - unsigned long arg2 = 0; - unsigned long arg3 = 0; - Py_buffer arg4; - - if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)"); - return NULL; - } - OrthancPluginCompressAndAnswerPngImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf); - PyBuffer_Release(&arg4); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginRedirect( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginRedirect() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPluginRedirect(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatusCode( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendHttpStatusCode() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned short arg0 = 0; - - if (!PyArg_ParseTuple(args, "H", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendUnauthorized( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendUnauthorized() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPluginSendUnauthorized(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMethodNotAllowed( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendMethodNotAllowed() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPluginSendMethodNotAllowed(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetCookie( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSetCookie() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - OrthancPluginSetCookie(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpHeader( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSetHttpHeader() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - OrthancPluginSetHttpHeader(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginStartMultipartAnswer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStartMultipartAnswer() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - OrthancPluginErrorCode code = OrthancPluginStartMultipartAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMultipartItem( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendMultipartItem() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "s*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPluginErrorCode code = OrthancPluginSendMultipartItem(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); - PyBuffer_Release(&arg0); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatus( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendHttpStatus() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned short arg0 = 0; - const char* arg1 = NULL; - unsigned long arg2 = 0; - - if (!PyArg_ParseTuple(args, "Hsk", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - OrthancPluginSendHttpStatus(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2); - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerJpegImage( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerJpegImage() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - unsigned long arg1 = 0; - unsigned long arg2 = 0; - unsigned long arg3 = 0; - Py_buffer arg4; - unsigned char arg5 = 0; - - if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); - return NULL; - } - OrthancPluginCompressAndAnswerJpegImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5); - PyBuffer_Release(&arg4); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpErrorDetails( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSetHttpErrorDetails() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - unsigned char arg1 = 0; - - if (!PyArg_ParseTuple(args, "sb", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - OrthancPluginSetHttpErrorDetails(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - - - Py_INCREF(Py_None); - return Py_None; -} - - - static void RegisterOrthancPluginRestOutputClass(PyObject* module) { sdk_OrthancPluginRestOutput_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,358 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginAnswerBuffer( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginAnswerBuffer() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + Py_buffer arg0; + const char* arg2 = NULL; + + if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len, arg2); + PyBuffer_Release(&arg0); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerPngImage( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerPngImage() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + long int arg0 = 0; + unsigned long arg1 = 0; + unsigned long arg2 = 0; + unsigned long arg3 = 0; + Py_buffer arg4; + + if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)"); + return NULL; + } + OrthancPluginCompressAndAnswerPngImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf); + PyBuffer_Release(&arg4); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginRedirect( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginRedirect() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + + if (!PyArg_ParseTuple(args, "s", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPluginRedirect(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatusCode( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSendHttpStatusCode() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned short arg0 = 0; + + if (!PyArg_ParseTuple(args, "H", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendUnauthorized( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSendUnauthorized() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + + if (!PyArg_ParseTuple(args, "s", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPluginSendUnauthorized(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMethodNotAllowed( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSendMethodNotAllowed() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + + if (!PyArg_ParseTuple(args, "s", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPluginSendMethodNotAllowed(OrthancPlugins::GetGlobalContext(), self->object_, arg0); + + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetCookie( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSetCookie() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + const char* arg1 = NULL; + + if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + OrthancPluginSetCookie(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); + + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpHeader( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSetHttpHeader() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + const char* arg1 = NULL; + + if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + OrthancPluginSetHttpHeader(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); + + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginStartMultipartAnswer( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginStartMultipartAnswer() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + const char* arg1 = NULL; + + if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + OrthancPluginErrorCode code = OrthancPluginStartMultipartAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); + + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMultipartItem( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSendMultipartItem() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + Py_buffer arg0; + + if (!PyArg_ParseTuple(args, "s*", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPluginErrorCode code = OrthancPluginSendMultipartItem(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); + PyBuffer_Release(&arg0); + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatus( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSendHttpStatus() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + unsigned short arg0 = 0; + const char* arg1 = NULL; + unsigned long arg2 = 0; + + if (!PyArg_ParseTuple(args, "Hsk", &arg0, &arg1, &arg2)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); + return NULL; + } + OrthancPluginSendHttpStatus(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2); + + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerJpegImage( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerJpegImage() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + long int arg0 = 0; + unsigned long arg1 = 0; + unsigned long arg2 = 0; + unsigned long arg3 = 0; + Py_buffer arg4; + unsigned char arg5 = 0; + + if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); + return NULL; + } + OrthancPluginCompressAndAnswerJpegImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5); + PyBuffer_Release(&arg4); + + Py_INCREF(Py_None); + return Py_None; +} + +static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpErrorDetails( + sdk_OrthancPluginRestOutput_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginSetHttpErrorDetails() on object of class OrthancPluginRestOutput"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + unsigned char arg1 = 0; + + if (!PyArg_ParseTuple(args, "sb", &arg0, &arg1)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + OrthancPluginSetHttpErrorDetails(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); + + + Py_INCREF(Py_None); + return Py_None; +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginServerChunkedRequestReader.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginServerChunkedRequestReader.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -70,9 +70,6 @@ -// Actual implementation of the methods - - static void RegisterOrthancPluginServerChunkedRequestReaderClass(PyObject* module) { sdk_OrthancPluginServerChunkedRequestReader_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginServerChunkedRequestReader.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,1 @@ +// Actual implementation of the methods
--- a/Sources/Autogenerated/sdk_OrthancPluginStorageArea.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginStorageArea.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -90,145 +90,6 @@ -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaCreate( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStorageAreaCreate() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - Py_buffer arg1; - unsigned long long arg2 = 0; - long int arg3 = 0; - - if (!PyArg_ParseTuple(args, "ss*Kl", &arg0, &arg1, &arg2, &arg3)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); - return NULL; - } - OrthancPluginErrorCode code = OrthancPluginStorageAreaCreate(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1.buf, arg2, static_cast<OrthancPluginContentType>(arg3)); - PyBuffer_Release(&arg1); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRead( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStorageAreaRead() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - long int arg1 = 0; - - if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code = OrthancPluginStorageAreaRead(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0, static_cast<OrthancPluginContentType>(arg1)); - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRemove( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStorageAreaRemove() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - long int arg1 = 0; - - if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - OrthancPluginErrorCode code = OrthancPluginStorageAreaRemove(OrthancPlugins::GetGlobalContext(), self->object_, arg0, static_cast<OrthancPluginContentType>(arg1)); - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginReconstructMainDicomTags( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginReconstructMainDicomTags() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - - if (!PyArg_ParseTuple(args, "l", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - OrthancPluginErrorCode code = OrthancPluginReconstructMainDicomTags(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginResourceType>(arg0)); - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - - - static void RegisterOrthancPluginStorageAreaClass(PyObject* module) { sdk_OrthancPluginStorageArea_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginStorageArea.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,137 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaCreate( + sdk_OrthancPluginStorageArea_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginStorageAreaCreate() on object of class OrthancPluginStorageArea"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + Py_buffer arg1; + unsigned long long arg2 = 0; + long int arg3 = 0; + + if (!PyArg_ParseTuple(args, "ss*Kl", &arg0, &arg1, &arg2, &arg3)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); + return NULL; + } + OrthancPluginErrorCode code = OrthancPluginStorageAreaCreate(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1.buf, arg2, static_cast<OrthancPluginContentType>(arg3)); + PyBuffer_Release(&arg1); + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRead( + sdk_OrthancPluginStorageArea_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginStorageAreaRead() on object of class OrthancPluginStorageArea"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + long int arg1 = 0; + + if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + OrthancPlugins::MemoryBuffer buffer; + OrthancPluginErrorCode code = OrthancPluginStorageAreaRead(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0, static_cast<OrthancPluginContentType>(arg1)); + + if (code == OrthancPluginErrorCode_Success) + { + return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRemove( + sdk_OrthancPluginStorageArea_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginStorageAreaRemove() on object of class OrthancPluginStorageArea"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + const char* arg0 = NULL; + long int arg1 = 0; + + if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); + return NULL; + } + OrthancPluginErrorCode code = OrthancPluginStorageAreaRemove(OrthancPlugins::GetGlobalContext(), self->object_, arg0, static_cast<OrthancPluginContentType>(arg1)); + + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} + +static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginReconstructMainDicomTags( + sdk_OrthancPluginStorageArea_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginReconstructMainDicomTags() on object of class OrthancPluginStorageArea"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + long int arg0 = 0; + + if (!PyArg_ParseTuple(args, "l", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + OrthancPluginErrorCode code = OrthancPluginReconstructMainDicomTags(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginResourceType>(arg0)); + + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginStorageCommitmentFailureReason.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginStorageCommitmentFailureReason.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,13 +64,48 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "SUCCESS", PyLong_FromLong(0)); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "PROCESSING_FAILURE", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "NO_SUCH_OBJECT_INSTANCE", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "RESOURCE_LIMITATION", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "REFERENCED_SOPCLASS_NOT_SUPPORTED", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "CLASS_INSTANCE_CONFLICT", PyLong_FromLong(5)); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "DUPLICATE_TRANSACTION_UID", PyLong_FromLong(6)); + { + PyObject* tmp = PyLong_FromLong(0); + PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "SUCCESS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "PROCESSING_FAILURE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "NO_SUCH_OBJECT_INSTANCE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "RESOURCE_LIMITATION", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "REFERENCED_SOPCLASS_NOT_SUPPORTED", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(5); + PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "CLASS_INSTANCE_CONFLICT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(6); + PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "DUPLICATE_TRANSACTION_UID", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginStorageCommitmentFailureReason_Type); if (PyModule_AddObject(module, "StorageCommitmentFailureReason", (PyObject *)&sdk_OrthancPluginStorageCommitmentFailureReason_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginValueRepresentation.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginValueRepresentation.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -64,33 +64,168 @@ * (in your module initialization function)." **/ - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AE", PyLong_FromLong(1)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AS", PyLong_FromLong(2)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AT", PyLong_FromLong(3)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "CS", PyLong_FromLong(4)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DA", PyLong_FromLong(5)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DS", PyLong_FromLong(6)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DT", PyLong_FromLong(7)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "FD", PyLong_FromLong(8)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "FL", PyLong_FromLong(9)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "IS", PyLong_FromLong(10)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "LO", PyLong_FromLong(11)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "LT", PyLong_FromLong(12)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OB", PyLong_FromLong(13)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OF", PyLong_FromLong(14)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OW", PyLong_FromLong(15)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "PN", PyLong_FromLong(16)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SH", PyLong_FromLong(17)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SL", PyLong_FromLong(18)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SQ", PyLong_FromLong(19)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SS", PyLong_FromLong(20)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "ST", PyLong_FromLong(21)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "TM", PyLong_FromLong(22)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UI", PyLong_FromLong(23)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UL", PyLong_FromLong(24)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UN", PyLong_FromLong(25)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "US", PyLong_FromLong(26)); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UT", PyLong_FromLong(27)); + { + PyObject* tmp = PyLong_FromLong(1); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AE", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(2); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(3); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(4); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "CS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(5); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DA", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(6); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(7); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(8); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "FD", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(9); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "FL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(10); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "IS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(11); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "LO", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(12); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "LT", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(13); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OB", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(14); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OF", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(15); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OW", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(16); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "PN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(17); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SH", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(18); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(19); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SQ", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(20); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SS", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(21); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "ST", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(22); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "TM", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(23); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UI", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(24); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UL", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(25); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UN", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(26); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "US", tmp); + Py_DECREF(tmp); + } + + { + PyObject* tmp = PyLong_FromLong(27); + PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UT", tmp); + Py_DECREF(tmp); + } + Py_INCREF(&sdk_OrthancPluginValueRepresentation_Type); if (PyModule_AddObject(module, "ValueRepresentation", (PyObject *)&sdk_OrthancPluginValueRepresentation_Type) < 0)
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -80,36 +80,6 @@ -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistMarkIncomplete( - sdk_OrthancPluginWorklistAnswers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginWorklistMarkIncomplete() on object of class OrthancPluginWorklistAnswers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPluginErrorCode code = OrthancPluginWorklistMarkIncomplete(OrthancPlugins::GetGlobalContext(), self->object_); - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - - - static void RegisterOrthancPluginWorklistAnswersClass(PyObject* module) { sdk_OrthancPluginWorklistAnswers_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,28 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistMarkIncomplete( + sdk_OrthancPluginWorklistAnswers_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginWorklistMarkIncomplete() on object of class OrthancPluginWorklistAnswers"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPluginErrorCode code = OrthancPluginWorklistMarkIncomplete(OrthancPlugins::GetGlobalContext(), self->object_); + + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} +
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.impl.h Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.impl.h Wed Aug 30 11:52:45 2023 +0200 @@ -80,58 +80,6 @@ -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch( - sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginWorklistIsMatch() on object of class OrthancPluginWorklistQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "s*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - long value = OrthancPluginWorklistIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); - PyBuffer_Release(&arg0); - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery( - sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginWorklistGetDicomQuery() on object of class OrthancPluginWorklistQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code = OrthancPluginWorklistGetDicomQuery(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - - - static void RegisterOrthancPluginWorklistQueryClass(PyObject* module) { sdk_OrthancPluginWorklistQuery_Type.tp_new = PyType_GenericNew;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,50 @@ +// Actual implementation of the methods +static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch( + sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginWorklistIsMatch() on object of class OrthancPluginWorklistQuery"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + Py_buffer arg0; + + if (!PyArg_ParseTuple(args, "s*", &arg0)) + { + PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); + return NULL; + } + long value = OrthancPluginWorklistIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, arg0.buf, arg0.len); + PyBuffer_Release(&arg0); + return PyLong_FromLong(value); +} + +static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery( + sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) +{ + PythonLock::LogCall("Calling method OrthancPluginWorklistGetDicomQuery() on object of class OrthancPluginWorklistQuery"); + + if (self->object_ == NULL) + { + PyErr_SetString(PyExc_ValueError, "Invalid object"); + return NULL; + } + + + OrthancPlugins::MemoryBuffer buffer; + OrthancPluginErrorCode code = OrthancPluginWorklistGetDicomQuery(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); + + if (code == OrthancPluginErrorCode_Success) + { + return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} +
--- a/Sources/DicomScpCallbacks.cpp Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/DicomScpCallbacks.cpp Wed Aug 30 11:52:45 2023 +0200 @@ -295,50 +295,53 @@ { PythonString tmp(lock, level); - PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.GetPyObject()); } { PythonString tmp(lock, patientId_); - PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.GetPyObject()); } { PythonString tmp(lock, accessionNumber_); - PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.GetPyObject()); } { PythonString tmp(lock, studyInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, seriesInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, sopInstanceUid_); - PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject()); } { PythonString tmp(lock, originatorAet_); - PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.GetPyObject()); } { PythonString tmp(lock, sourceAet_); - PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.GetPyObject()); } { PythonString tmp(lock, targetAet_); - PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", PyLong_FromUnsignedLong(originatorId_)); + { + PythonObject tmp(lock, PyLong_FromUnsignedLong(originatorId_)); + PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", tmp.GetPyObject()); + } PythonObject args(lock, PyTuple_New(0));
--- a/Sources/IncomingHttpRequestFilter.cpp Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/IncomingHttpRequestFilter.cpp Wed Aug 30 11:52:45 2023 +0200 @@ -51,11 +51,15 @@ } PythonObject kw(lock, PyDict_New()); - PyDict_SetItemString(kw.GetPyObject(), "method", PyLong_FromLong(method)); + + { + PythonObject tmp(lock, PyLong_FromLong(method)); + PyDict_SetItemString(kw.GetPyObject(), "method", tmp.GetPyObject()); + } { PythonString str(lock, ip); - PyDict_SetItemString(kw.GetPyObject(), "ip", str.Release()); + PyDict_SetItemString(kw.GetPyObject(), "ip", str.GetPyObject()); } { @@ -64,10 +68,10 @@ for (uint32_t i = 0; i < headersCount; i++) { PythonString str(lock, headersValues[i]); - PyDict_SetItemString(headers.GetPyObject(), headersKeys[i], str.Release()); + PyDict_SetItemString(headers.GetPyObject(), headersKeys[i], str.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "headers", headers.Release()); + PyDict_SetItemString(kw.GetPyObject(), "headers", headers.GetPyObject()); } if (method == OrthancPluginHttpMethod_Get) @@ -77,10 +81,10 @@ for (uint32_t i = 0; i < getArgumentsCount; i++) { PythonString str(lock, getArgumentsValues[i]); - PyDict_SetItemString(getArguments.GetPyObject(), getArgumentsKeys[i], str.Release()); + PyDict_SetItemString(getArguments.GetPyObject(), getArgumentsKeys[i], str.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "get", getArguments.Release()); + PyDict_SetItemString(kw.GetPyObject(), "get", getArguments.GetPyObject()); } PythonObject result(lock, PyObject_Call(incomingHttpRequestFilter_,
--- a/Sources/Plugin.cpp Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/Plugin.cpp Wed Aug 30 11:52:45 2023 +0200 @@ -43,6 +43,7 @@ #include <boost/algorithm/string/predicate.hpp> #include <boost/filesystem.hpp> +#include <boost/thread.hpp> // The "dl_iterate_phdr()" function (to walk through shared libraries) // is not available on Microsoft Windows and Apple OS X @@ -81,11 +82,31 @@ PythonLock lock; PythonObject kw(lock, PyDict_New()); - PyDict_SetItemString(kw.GetPyObject(), "Group", PyLong_FromUnsignedLong(entry.group)); - PyDict_SetItemString(kw.GetPyObject(), "Element", PyLong_FromUnsignedLong(entry.element)); - PyDict_SetItemString(kw.GetPyObject(), "ValueRepresentation", PyLong_FromUnsignedLong(entry.vr)); - PyDict_SetItemString(kw.GetPyObject(), "MinMultiplicity", PyLong_FromUnsignedLong(entry.minMultiplicity)); - PyDict_SetItemString(kw.GetPyObject(), "MaxMultiplicity", PyLong_FromUnsignedLong(entry.maxMultiplicity)); + + { + PythonObject tmp(lock, PyLong_FromUnsignedLong(entry.group)); + PyDict_SetItemString(kw.GetPyObject(), "Group", tmp.GetPyObject()); + } + + { + PythonObject tmp(lock, PyLong_FromUnsignedLong(entry.element)); + PyDict_SetItemString(kw.GetPyObject(), "Element", tmp.GetPyObject()); + } + + { + PythonObject tmp(lock, PyLong_FromUnsignedLong(entry.vr)); + PyDict_SetItemString(kw.GetPyObject(), "ValueRepresentation", tmp.GetPyObject()); + } + + { + PythonObject tmp(lock, PyLong_FromUnsignedLong(entry.minMultiplicity)); + PyDict_SetItemString(kw.GetPyObject(), "MinMultiplicity", tmp.GetPyObject()); + } + + { + PythonObject tmp(lock, PyLong_FromUnsignedLong(entry.maxMultiplicity)); + PyDict_SetItemString(kw.GetPyObject(), "MaxMultiplicity", tmp.GetPyObject()); + } return kw.Release(); } @@ -284,6 +305,8 @@ static bool pythonEnabled_ = false; static std::string userScriptName_; static std::vector<PyMethodDef> globalFunctions_; +static boost::thread displayMemoryUsageThread_; +static bool displayMemoryUsageStopping_ = false; static void InstallClasses(PyObject* module) @@ -471,6 +494,27 @@ #endif +static void DisplayMemoryUsageThread() +{ + { + PythonLock lock; + lock.ExecuteCommand("import tracemalloc"); + lock.ExecuteCommand("tracemalloc.start()"); + } + + while (!displayMemoryUsageStopping_) + { + { + PythonLock lock; + lock.ExecuteCommand("print('Python memory usage: %0.03fMB' % " + "(tracemalloc.get_traced_memory() [0] / (1024.0 * 1024.0)))"); + } + + boost::this_thread::sleep(boost::posix_time::seconds(1)); + } +} + + extern "C" { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c) @@ -500,16 +544,18 @@ * Detection of the user script **/ - OrthancPlugins::OrthancConfiguration config; + OrthancPlugins::OrthancConfiguration globalConfig; - static const char* const OPTION = "PythonScript"; - + OrthancPlugins::OrthancConfiguration pythonConfig; + globalConfig.GetSection(pythonConfig, "Python"); + std::string script; - if (!config.LookupStringValue(script, OPTION)) + if (!globalConfig.LookupStringValue(script, "PythonScript") && + !pythonConfig.LookupStringValue(script, "Path")) { pythonEnabled_ = false; - OrthancPlugins::LogWarning("The option \"" + std::string(OPTION) + "\" is not provided: " + + OrthancPlugins::LogWarning("Options \"PythonScript\" and \"Python.Path\" are not provided: " "Python scripting is disabled"); } else @@ -550,16 +596,22 @@ * Initialization of Python **/ + const bool isVerbose = (globalConfig.GetBooleanValue("PythonVerbose", false) || + pythonConfig.GetBooleanValue("Verbose", false)); + #if HAS_DL_ITERATE == 1 dl_iterate_phdr(ForceImportCallback, NULL); #endif SetupGlobalFunctions(); - PythonLock::GlobalInitialize("orthanc", "OrthancException", - GetGlobalFunctions, InstallClasses, - config.GetBooleanValue("PythonVerbose", false)); + PythonLock::GlobalInitialize("orthanc", "OrthancException", GetGlobalFunctions, InstallClasses, isVerbose); PythonLock::AddSysPath(userScriptDirectory.string()); + if (pythonConfig.GetBooleanValue("DisplayMemoryUsage", false)) + { + displayMemoryUsageThread_ = boost::thread(DisplayMemoryUsageThread); + } + /** * Force loading the declarations in the user script @@ -602,6 +654,13 @@ FinalizeOnStoredInstanceCallback(); FinalizeIncomingHttpRequestFilter(); FinalizeDicomScpCallbacks(); + + displayMemoryUsageStopping_ = true; + + if (displayMemoryUsageThread_.joinable()) + { + displayMemoryUsageThread_.join(); + } PythonLock::GlobalFinalize(); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/PythonBytes.cpp Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,51 @@ +/** + * Python plugin for Orthanc + * Copyright (C) 2020-2022 Osimis S.A., Belgium + * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + **/ + + +#include "PythonBytes.h" + +#include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" + + +void PythonBytes::SanityCheck() +{ + if (!bytes_->IsValid()) + { + OrthancPlugins::LogError("Cannot create Python bytes"); + ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); + } +} + + +PythonBytes::PythonBytes(PythonLock& lock, + const void* data, + size_t size) +{ + if (data == NULL && + size != 0) + { + ORTHANC_PLUGINS_THROW_EXCEPTION(NullPointer); + } + else + { + PyObject* obj = PyBytes_FromStringAndSize(reinterpret_cast<const char*>(data), size); + bytes_.reset(new PythonObject(lock, obj)); + SanityCheck(); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/PythonBytes.h Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,49 @@ +/** + * Python plugin for Orthanc + * Copyright (C) 2020-2022 Osimis S.A., Belgium + * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + **/ + + +#pragma once + +#include "PythonObject.h" + +#include <Compatibility.h> // For std::unique_ptr + +// A Python string is always valid, or an exception was thrown on its creation +class PythonBytes : public boost::noncopyable +{ +private: + std::unique_ptr<PythonObject> bytes_; + + void SanityCheck(); + +public: + PythonBytes(PythonLock& lock, + const void* data, + size_t size); + + PyObject* GetPyObject() const + { + return bytes_->GetPyObject(); + } + + PyObject* Release() + { + return bytes_->Release(); + } +};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sources/README.txt Wed Aug 30 11:52:45 2023 +0200 @@ -0,0 +1,44 @@ + +Note about the "memory leaks" in the Python allocators +====================================================== + +This concerns functions "PyTuple_SetItem()" and +"PyDict_SetItemString()", whose documentation is the following: + +>>>>> +* int PyTuple_SetItem(PyObject *p, Py_ssize_t pos, PyObject *o) + + Insert a reference to object o at position pos of the tuple pointed + to by p. Return 0 on success. If pos is out of bounds, return -1 and + set an IndexError exception. + + Note: This function "steals" a reference to o and discards a + reference to an item already in the tuple at the affected position. + +* int PyDict_SetItemString(PyObject *p, const char *key, PyObject *val) + + Insert val into the dictionary p using key as a key. key should be a + const char* UTF-8 encoded bytes string. The key object is created + using PyUnicode_FromString(key). Return 0 on success or -1 on + failure. This function does not steal a reference to val. +<<<<< + + +As can be seen: + +* PyTuple_SetItem() steals the reference. + +* PyDict_SetItemString() does *not* steal the reference. + + +Consequently, when passing an object created by the Orthanc Python +plugin: + +* PyTuple_SetItem() must use "PythonObject::Release()". + +* PyDict_SetItemString() must use "PythonObject::GetPyObject()". + + +In releases <= 4.0 of the Python plugin, PyDict_SetItemString() was +using "PythonObject::Release()" instead of +"PythonObject::GetPyObject()", which resulted in memory leaks.
--- a/Sources/RestCallbacks.cpp Wed Aug 30 11:49:59 2023 +0200 +++ b/Sources/RestCallbacks.cpp Wed Aug 30 11:52:45 2023 +0200 @@ -22,6 +22,7 @@ #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" #include "Autogenerated/sdk.h" +#include "PythonBytes.h" #include "PythonString.h" #include <boost/regex.hpp> @@ -127,7 +128,7 @@ { PythonString tmp(lock, method); - PyDict_SetItemString(kw.GetPyObject(), "method", tmp.Release()); + PyDict_SetItemString(kw.GetPyObject(), "method", tmp.GetPyObject()); } { @@ -139,7 +140,7 @@ PyTuple_SetItem(groups.GetPyObject(), i, tmp.Release()); } - PyDict_SetItemString(kw.GetPyObject(), "groups", groups.Release()); + PyDict_SetItemString(kw.GetPyObject(), "groups", groups.GetPyObject()); } if (request->method == OrthancPluginHttpMethod_Get) @@ -149,10 +150,10 @@ for (uint32_t i = 0; i < request->getCount; i++) { PythonString value(lock, request->getValues[i]); - PyDict_SetItemString(get.GetPyObject(), request->getKeys[i], value.Release()); + PyDict_SetItemString(get.GetPyObject(), request->getKeys[i], value.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "get", get.Release()); + PyDict_SetItemString(kw.GetPyObject(), "get", get.GetPyObject()); } { @@ -161,17 +162,17 @@ for (uint32_t i = 0; i < request->headersCount; i++) { PythonString value(lock, request->headersValues[i]); - PyDict_SetItemString(headers.GetPyObject(), request->headersKeys[i], value.Release()); + PyDict_SetItemString(headers.GetPyObject(), request->headersKeys[i], value.GetPyObject()); } - PyDict_SetItemString(kw.GetPyObject(), "headers", headers.Release()); + PyDict_SetItemString(kw.GetPyObject(), "headers", headers.GetPyObject()); } if (request->method == OrthancPluginHttpMethod_Post || request->method == OrthancPluginHttpMethod_Put) { - PyDict_SetItemString(kw.GetPyObject(), "body", PyBytes_FromStringAndSize( - reinterpret_cast<const char*>(request->body), request->bodySize)); + PythonBytes bytes(lock, request->body, request->bodySize); + PyDict_SetItemString(kw.GetPyObject(), "body", bytes.GetPyObject()); } /**