Mercurial > hg > orthanc-python
changeset 291:8ac57d645cd2
print functions that are not wrapped yet
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 Aug 2025 15:06:05 +0200 |
parents | 553cb41bf490 |
children | d15b6b165663 |
files | CodeAnalysis/CustomFunctions.json CodeAnalysis/CustomMethods.json CodeAnalysis/GenerateOrthancSDK.py |
diffstat | 3 files changed, 62 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/CodeAnalysis/CustomFunctions.json Wed Aug 20 14:32:03 2025 +0200 +++ b/CodeAnalysis/CustomFunctions.json Wed Aug 20 15:06:05 2025 +0200 @@ -22,7 +22,11 @@ "callable_protocol_return" : "None" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ + "OrthancPluginRegisterRestCallback", + "OrthancPluginRegisterRestCallbackNoLock" + ] }, { @@ -43,7 +47,8 @@ "callable_protocol_return" : "None" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterOnChangeCallback" ] }, { @@ -64,7 +69,8 @@ "callable_protocol_return" : "None" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterOnStoredInstanceCallback" ] }, { @@ -86,7 +92,11 @@ "callable_protocol_return" : "bool" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ + "OrthancPluginRegisterIncomingHttpRequestFilter", + "OrthancPluginRegisterIncomingHttpRequestFilter2" + ] }, { @@ -106,7 +116,8 @@ "sdk_type" : "const char *" } ], - "return_sdk_type" : "Dictionary" + "return_sdk_type" : "Dictionary", + "sdk_functions" : [ "OrthancPluginLookupDictionary" ] }, { @@ -148,7 +159,8 @@ } ], "return_sdk_type" : "object", - "return_sdk_class" : "OrthancPluginImage" + "return_sdk_class" : "OrthancPluginImage", + "sdk_functions" : [ "OrthancPluginCreateImageAccessor" ] }, { @@ -170,7 +182,8 @@ "callable_protocol_return" : "None" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterFindCallback" ] }, { @@ -192,7 +205,8 @@ "callable_protocol_return" : "None" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterMoveCallback" ] }, { @@ -260,7 +274,8 @@ "callable_protocol_return" : "None" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterWorklistCallback" ] }, { @@ -298,7 +313,8 @@ "callable_protocol_return" : "None" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterStorageArea" ] }, { @@ -320,7 +336,8 @@ "callable_protocol_return" : "int" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterIncomingCStoreInstanceFilter" ] }, { @@ -342,7 +359,8 @@ "callable_protocol_return" : "tuple[ReceivedInstanceAction, bytes]" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterReceivedInstanceCallback" ] }, { @@ -372,7 +390,8 @@ "callable_protocol_return" : "StorageCommitmentFailureReason" } ], - "return_sdk_type" : "void" + "return_sdk_type" : "void", + "sdk_functions" : [ "OrthancPluginRegisterStorageCommitmentScpCallback" ] }, { @@ -398,7 +417,8 @@ } ], "return_sdk_type" : "OrthancPluginMemoryBuffer *", - "since_sdk" : [ 1, 12, 8 ] + "since_sdk" : [ 1, 12, 8 ], + "sdk_functions" : [ "OrthancPluginGetKeyValue" ] }, { @@ -425,7 +445,8 @@ } ], "return_sdk_type" : "OrthancPluginMemoryBuffer *", - "since_sdk" : [ 1, 12, 8 ] + "since_sdk" : [ 1, 12, 8 ], + "sdk_functions" : [ "OrthancPluginDequeueValue" ] }, { @@ -446,7 +467,8 @@ } ], "return_sdk_type" : "uint64_t", - "since_sdk" : [ 1, 12, 8 ] + "since_sdk" : [ 1, 12, 8 ], + "sdk_functions" : [ "OrthancPluginGetQueueSize" ] }, { @@ -473,7 +495,8 @@ } ], "return_sdk_type" : "Tuple", - "since_sdk" : [ 1, 12, 9 ] + "since_sdk" : [ 1, 12, 9 ], + "sdk_functions" : [ "OrthancPluginSetStableStatus" ] } ]
--- a/CodeAnalysis/CustomMethods.json Wed Aug 20 14:32:03 2025 +0200 +++ b/CodeAnalysis/CustomMethods.json Wed Aug 20 15:06:05 2025 +0200 @@ -16,7 +16,8 @@ "sdk_type" : "uint32_t" } ], - "return_sdk_type" : "uint16_t" + "return_sdk_type" : "uint16_t", + "sdk_functions" : [ "OrthancPluginGetFindQueryTag" ] }, { @@ -49,7 +50,8 @@ }, "args" : [ ], - "return_sdk_type" : "OrthancPluginMemoryBuffer *" + "return_sdk_type" : "OrthancPluginMemoryBuffer *", + "sdk_functions" : [ "OrthancPluginGetInstanceData" ] } ], @@ -63,7 +65,8 @@ }, "args" : [ ], - "return_sdk_type" : "OrthancPluginMemoryBuffer *" + "return_sdk_type" : "OrthancPluginMemoryBuffer *", + "sdk_functions" : [ "OrthancPluginGetImageBuffer" ] } ], @@ -77,7 +80,8 @@ }, "args" : [ ], - "return_sdk_type" : "bool" + "return_sdk_type" : "bool", + "sdk_functions" : [ "OrthancPluginKeysValuesIteratorNext" ] } ] }
--- a/CodeAnalysis/GenerateOrthancSDK.py Wed Aug 20 14:32:03 2025 +0200 +++ b/CodeAnalysis/GenerateOrthancSDK.py Wed Aug 20 15:06:05 2025 +0200 @@ -420,6 +420,7 @@ globalFunctions = [] customFunctions = [] +unwrappedFunctions = model.get('unwrapped_functions', []) for f in model['global_functions']: if IsPrimitiveAvailable(f): @@ -428,6 +429,10 @@ globalFunctions.append(g) for f in CUSTOM_FUNCTIONS: + for sdk in f.get('sdk_functions', []): + if sdk in unwrappedFunctions: + unwrappedFunctions.remove(sdk) + if IsPrimitiveAvailable(f): f['documentation'] = DocumentFunction(f) customFunctions.append(f) @@ -490,6 +495,10 @@ if c['name'] in CUSTOM_METHODS: for custom_method in CUSTOM_METHODS[c['name']]: + for sdk in custom_method.get('sdk_functions', []): + if sdk in unwrappedFunctions: + unwrappedFunctions.remove(sdk) + if IsPrimitiveAvailable(custom_method): custom_method['self'] = True # Indicates that this is a method custom_method['documentation'] = DocumentFunction(custom_method) @@ -582,3 +591,8 @@ total = totalWrapped + len(sortedCustomFunctions) + countCustomMethods print('=> Total number of functions or methods in the Python wrapper: %d\n' % total) + +print('Functions in the latest Orthanc SDK that are not wrapped yet:') +for f in unwrappedFunctions: + print('- %s()' % f) +print('')