comparison CodeAnalysis/GenerateOrthancSDK.py @ 205:234681297600

documented orthanc.LookupDictionary()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 Jul 2024 12:35:13 +0200
parents 65ad095c25d8
children 4e6079e27965
comparison
equal deleted inserted replaced
204:65ad095c25d8 205:234681297600
178 elif a['sdk_type'] == 'const_object': 178 elif a['sdk_type'] == 'const_object':
179 arg_type = GetShortName(a['sdk_class']) 179 arg_type = GetShortName(a['sdk_class'])
180 elif a['sdk_type'] in [ 'int32_t', 'uint32_t', 'uint8_t', 'uint16_t', 'uint64_t' ]: 180 elif a['sdk_type'] in [ 'int32_t', 'uint32_t', 'uint8_t', 'uint16_t', 'uint64_t' ]:
181 arg_type = 'int' 181 arg_type = 'int'
182 elif a['sdk_type'] == 'Callable': 182 elif a['sdk_type'] == 'Callable':
183 # This is only used to generate the documentation file "orthanc.pyi"
183 arg_type = a['callable_type'] 184 arg_type = a['callable_type']
184 else: 185 else:
185 raise Exception('Argument type not implemented: %s' % a['sdk_type']) 186 raise Exception('Argument type not implemented: %s' % a['sdk_type'])
186 args_declaration.append('%s: %s' % (arg_name, arg_type)) 187 args_declaration.append('%s: %s' % (arg_name, arg_type))
187 args_documentation.append({ 188 args_documentation.append({
210 documentation['return_type'] = 'bytes' 211 documentation['return_type'] = 'bytes'
211 elif f['return_sdk_type'] in [ 'char *', 'const char *' ]: 212 elif f['return_sdk_type'] in [ 'char *', 'const char *' ]:
212 documentation['return_type'] = 'str' 213 documentation['return_type'] = 'str'
213 elif f['return_sdk_type'] in [ 'int32_t', 'uint32_t', 'uint16_t', 'int64_t' ]: 214 elif f['return_sdk_type'] in [ 'int32_t', 'uint32_t', 'uint16_t', 'int64_t' ]:
214 documentation['return_type'] = 'int' 215 documentation['return_type'] = 'int'
216 elif f['return_sdk_type'] == 'Dictionary':
217 # This is only used to generate the documentation file "orthanc.pyi"
218 documentation['return_type'] = 'dict'
215 else: 219 else:
216 raise Exception('Return type not implemented: %s' % f['return_sdk_type']) 220 raise Exception('Return type not implemented: %s' % f['return_sdk_type'])
217 221
218 if documentation['has_return']: 222 if documentation['has_return']:
219 documentation['return_text'] = f['documentation']['return'] 223 documentation['return_text'] = f['documentation']['return']