# HG changeset patch # User Sebastien Jodogne # Date 1719939388 -7200 # Node ID d7a6e75558ee7b88dead1b64ddf27fc1009ae1b3 # Parent 0c5da632f34d77139bef7007c5c5f3e5fb3e48c8 documented orthanc.RegisterOnChangeCallback() diff -r 0c5da632f34d -r d7a6e75558ee CodeAnalysis/CustomFunctions.json --- a/CodeAnalysis/CustomFunctions.json Tue Jul 02 18:47:12 2024 +0200 +++ b/CodeAnalysis/CustomFunctions.json Tue Jul 02 18:56:28 2024 +0200 @@ -21,5 +21,24 @@ } ], "return_sdk_type" : "void" + }, + + { + "short_name" : "RegisterOnChangeCallback", + "implementation" : "RegisterOnChangeCallback", + "documentation" : { + "description" : [ "Register a callback to monitor changes." ], + "args" : { + "callback" : "The callback function." + } + }, + "args" : [ + { + "sdk_name" : "callback", + "sdk_type" : "Callable", + "callable_type" : "typing.Callable[[ChangeType, ResourceType, str], None]" + } + ], + "return_sdk_type" : "void" } ] diff -r 0c5da632f34d -r d7a6e75558ee Sources/Autogenerated/orthanc.pyi --- a/Sources/Autogenerated/orthanc.pyi Tue Jul 02 18:47:12 2024 +0200 +++ b/Sources/Autogenerated/orthanc.pyi Tue Jul 02 18:56:28 2024 +0200 @@ -2090,6 +2090,15 @@ data (bytes): The content of the memory buffer. """ ... +# Register a callback to monitor changes +def RegisterOnChangeCallback(callback: typing.Callable[[ChangeType, ResourceType, str], None]) -> None: + """ + Register a callback to monitor changes. + + Args: + callback (typing.Callable[[ChangeType, ResourceType, str], None]): The callback function. + """ + ... # Register a REST callback def RegisterRestCallback(path_regular_expression: str, callback: typing.Callable[[RestOutput, str], None]) -> None: """ diff -r 0c5da632f34d -r d7a6e75558ee Sources/Autogenerated/sdk_GlobalFunctions.impl.h --- a/Sources/Autogenerated/sdk_GlobalFunctions.impl.h Tue Jul 02 18:47:12 2024 +0200 +++ b/Sources/Autogenerated/sdk_GlobalFunctions.impl.h Tue Jul 02 18:56:28 2024 +0200 @@ -23,6 +23,7 @@ // Forward declaration of the custom global functions +extern PyObject *RegisterOnChangeCallback(PyObject* module, PyObject *args); extern PyObject *RegisterRestCallback(PyObject* module, PyObject *args); // End of forward declarations @@ -2017,6 +2018,8 @@ "Generated from C function OrthancPluginUncompressImage()" }, { "WriteFile", sdk_OrthancPluginWriteFile, METH_VARARGS, "Generated from C function OrthancPluginWriteFile()" }, + { "RegisterOnChangeCallback", RegisterOnChangeCallback, METH_VARARGS, + "Implemented in C++ function RegisterOnChangeCallback()" }, { "RegisterRestCallback", RegisterRestCallback, METH_VARARGS, "Implemented in C++ function RegisterRestCallback()" }, { NULL, NULL } diff -r 0c5da632f34d -r d7a6e75558ee Sources/Plugin.cpp --- a/Sources/Plugin.cpp Tue Jul 02 18:47:12 2024 +0200 +++ b/Sources/Plugin.cpp Tue Jul 02 18:56:28 2024 +0200 @@ -284,11 +284,6 @@ std::list functions; { - PyMethodDef f = { "RegisterOnChangeCallback", RegisterOnChangeCallback, METH_VARARGS, "" }; - functions.push_back(f); - } - - { PyMethodDef f = { "RegisterOnStoredInstanceCallback", RegisterOnStoredInstanceCallback, METH_VARARGS, "" }; functions.push_back(f);