other minor tweaks - doc generation should still be broken
[plcapi.git] / doc / DocBookLocal.py
1 #!/usr/bin/env python
2
3 from PLC.API import PLCAPI
4 from PLC.Faults import PLCInvalidAPIMethod
5 from DocBook import DocBook
6 import sys
7
8 api = PLCAPI(None)
9 methods = api.all_methods
10 methods.sort()
11 good_apis = []
12 bad_apis = []
13 for method in methods:
14     try:
15         good_api = api.callable(method)
16         good_apis.append(good_api)
17     except PLCInvalidAPIMethod as exc:
18         bad_apis.append((method, exc))
19
20 DocBook(good_apis).Process()
21
22 if bad_apis:
23     sys.stderr.write("UNEXPECTED: There are %d non-callable methods:\n"
24                      % (len(bad_apis)))
25     for method, exc in bad_apis:
26         sys.stderr.write("\tmethod=<%s> exc=%s\n" % (method, exc))
27     sys.exit(-1)