forked from orthanc-server/orthanc-setup-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.py
More file actions
20 lines (17 loc) · 818 Bytes
/
doc.py
File metadata and controls
20 lines (17 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# inspect the python API of the "orthanc" module
import inspect
import orthanc
import numbers
for (name, obj) in inspect.getmembers(orthanc):
if inspect.isroutine(obj):
print('Function %s():\n Documentation: %s\n' % (name, inspect.getdoc(obj)))
elif inspect.isclass(obj):
print('Class %s:\n Documentation: %s' % (name, inspect.getdoc(obj)))
# Loop over the members of the class
for (subname, subobj) in inspect.getmembers(obj):
if isinstance(subobj, numbers.Number):
print(' - Enumeration value %s: %s' % (subname, subobj))
elif (not subname.startswith('_') and
inspect.ismethoddescriptor(subobj)):
print(' - Method %s(): %s' % (subname, inspect.getdoc(subobj)))
print('')