From 742468e6d0f4d6d94d73d6b5f4ebf32e96985221 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Tue, 17 Mar 2009 14:53:31 +0000 Subject: [PATCH 1/1] minor cleanup to be more verbose when there are errors; most of the time when we have these errors its because the environment we are building in is missing some required python module --- doc/DocBookLocal.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/DocBookLocal.py b/doc/DocBookLocal.py index 1eef1a2..1290610 100755 --- a/doc/DocBookLocal.py +++ b/doc/DocBookLocal.py @@ -1,11 +1,25 @@ #!/usr/bin/env python from PLC.API import PLCAPI +from PLC.Faults import PLCInvalidAPIMethod from DocBook import DocBook +import sys -def api_methods(): - api = PLCAPI(None) - methods = api.all_methods - return [api.callable(method) for method in methods] +api = PLCAPI(None) +methods = api.all_methods +good_apis = [] +bad_apis = [] +for method in methods: + try: + good_api = api.callable(method) + good_apis.append(good_api) + except PLCInvalidAPIMethod, e: + bad_apis.append((method,e)) -DocBook(api_methods ()).Process() +DocBook(good_apis).Process() + +if len(bad_apis): + sys.stderr.write("UNEXPECTED: There are %d non-callable methods:\n") + for bad_api,e in bad_apis: + sys.stderr.write("\t%s:%s\n" % (bad_api,e)) + sys.exit(-1) -- 2.43.0