# HG changeset patch # User Sebastien Jodogne # Date 1720002092 -7200 # Node ID 65ad095c25d8e36f80666716ac2b66a840b3f713 # Parent 28531e615104a534d2ed88a48f4cd4c8c2ca3870 report statistics in GenerateOrthancSDK.py diff -r 28531e615104 -r 65ad095c25d8 CodeAnalysis/GenerateOrthancSDK.py --- a/CodeAnalysis/GenerateOrthancSDK.py Wed Jul 03 12:03:09 2024 +0200 +++ b/CodeAnalysis/GenerateOrthancSDK.py Wed Jul 03 12:21:32 2024 +0200 @@ -380,6 +380,8 @@ classes = [] +countDestructors = 0 + for c in model['classes']: methods = [] @@ -406,6 +408,7 @@ }) if 'destructor' in c: + countDestructors += 1 classes[-1]['destructor'] = c['destructor'] @@ -460,10 +463,26 @@ })) -countMethods = 0 + +## +## Print statistics +## + +countWrappedMethods = 0 +countCustomMethods = 0 for c in sortedClasses: - countMethods += len(c['methods']) + countWrappedMethods += len(c['methods']) + countCustomMethods += len(c['custom_methods']) -print('\nNumber of wrapped global functions: %d' % len(sortedGlobalFunctions + sortedCustomFunctions)) -print('Number of wrapped methods: %d\n' % countMethods) -print('Total number of wrapped global functions or methods: %d\n' % (len(sortedGlobalFunctions + sortedCustomFunctions) + countMethods)) +print('\nNumber of automatically wrapped global functions: %d' % len(sortedGlobalFunctions)) +print('Number of automatically wrapped methods: %d' % countWrappedMethods) +print('Number of automatically wrapped destructors: %d' % countDestructors) +print('Number of manually implemented (custom) global functions: %d' % len(sortedCustomFunctions)) +print('Number of manually implemented (custom) methods: %d' % countCustomMethods) + +totalWrapped = (len(sortedGlobalFunctions) + countWrappedMethods + countDestructors) +print('\nTotal number of automatically wrapped functions (including destructors): %d' % totalWrapped) +print('NB: This number must correspond to "ParseOrthancSDK.py" in "orthanc-java"') + +total = totalWrapped + len(sortedCustomFunctions) + countCustomMethods +print('\n=> Total number of functions or methods in the Python SDK: %d\n' % total)