Mercurial > hg > orthanc-python
comparison CodeAnalysis/Enumeration.mustache @ 171:c8de83fe7faa
removed deprecation warnings
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 27 Jun 2024 15:52:51 +0200 |
parents | 6fada29b6759 |
children | 55473de7694f |
comparison
equal
deleted
inserted
replaced
170:b49eeb36cd0d | 171:c8de83fe7faa |
---|---|
45 | 45 |
46 sdk_{{name}}_Type.tp_dict = PyDict_New(); | 46 sdk_{{name}}_Type.tp_dict = PyDict_New(); |
47 | 47 |
48 if (PyType_Ready(&sdk_{{name}}_Type) < 0) | 48 if (PyType_Ready(&sdk_{{name}}_Type) < 0) |
49 { | 49 { |
50 OrthancPlugins::LogError("Cannot register Python enumeration: {{name}}"); | 50 ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: {{name}}"); |
51 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); | 51 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); |
52 } | 52 } |
53 | 53 |
54 /** | 54 /** |
55 * Declare constants here (static members = class attributes) | 55 * Declare constants here (static members = class attributes) |
75 {{/values}} | 75 {{/values}} |
76 | 76 |
77 Py_INCREF(&sdk_{{name}}_Type); | 77 Py_INCREF(&sdk_{{name}}_Type); |
78 if (PyModule_AddObject(module, "{{short_name}}", (PyObject *)&sdk_{{name}}_Type) < 0) | 78 if (PyModule_AddObject(module, "{{short_name}}", (PyObject *)&sdk_{{name}}_Type) < 0) |
79 { | 79 { |
80 OrthancPlugins::LogError("Cannot register Python enumeration: {{name}}"); | 80 ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: {{name}}"); |
81 Py_DECREF(&sdk_{{name}}_Type); | 81 Py_DECREF(&sdk_{{name}}_Type); |
82 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); | 82 ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); |
83 } | 83 } |
84 } | 84 } |