X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4e735ed6a6973429c5964c30825862a10949619c..c29c95fe24973b94fd724db767193171ca7c513d:/docs/doxygen/scripts/doxymlparser.py diff --git a/docs/doxygen/scripts/doxymlparser.py b/docs/doxygen/scripts/doxymlparser.py index 414cf988d2..a880524fc8 100755 --- a/docs/doxygen/scripts/doxymlparser.py +++ b/docs/doxygen/scripts/doxymlparser.py @@ -1,7 +1,7 @@ """ Name: doxymlparser.py Author: Kevin Ollivier -License: wxWidgets License +Licence: wxWindows licence """ __description__ = """ @@ -23,30 +23,9 @@ import string import sys import types -from xml.dom import minidom - -option_dict = { - "report" : (False, "Print out the classes and methods found by this script."), - "verbose" : (False, "Provide status updates and other information."), - } - -parser = optparse.OptionParser(usage="usage: %prog [options] \n" + __description__, version="%prog 1.0") -for opt in option_dict: - default = option_dict[opt][0] - - action = "store" - if type(default) == types.BooleanType: - action = "store_true" - parser.add_option("--" + opt, default=default, action=action, dest=opt, help=option_dict[opt][1]) - -options, arguments = parser.parse_args() - -def get_first_value(alist): - if len(alist) > 0: - return alist[0] - else: - return "" +from common import * +from xml.dom import minidom class ClassDefinition: def __init__(self): @@ -117,8 +96,9 @@ def doxyMLToText(node): return text class DoxyMLParser: - def __init__(self): + def __init__(self, verbose = False): self.classes = [] + self.verbose = verbose def find_class(self, name): for aclass in self.classes: @@ -208,7 +188,7 @@ class DoxyMLParser: param[child.nodeName] = getTextValue(child) new_method.params.append(param) - if options.verbose: + if self.verbose: print "Adding %s" % (new_method.name + new_method.argsstring) if new_method.name == new_class.name: @@ -219,11 +199,28 @@ class DoxyMLParser: new_class.methods.append(new_method) if __name__ == "__main__": + option_dict = { + "report" : (False, "Print out the classes and methods found by this script."), + "verbose" : (False, "Provide status updates and other information."), + } + + parser = optparse.OptionParser(usage="usage: %prog [options] \n" + __description__, version="%prog 1.0") + + for opt in option_dict: + default = option_dict[opt][0] + + action = "store" + if type(default) == types.BooleanType: + action = "store_true" + parser.add_option("--" + opt, default=default, action=action, dest=opt, help=option_dict[opt][1]) + + options, arguments = parser.parse_args() + if len(arguments) < 1: parser.print_usage() sys.exit(1) - doxyparse = DoxyMLParser() + doxyparse = DoxyMLParser(verbose = options.verbose) for arg in arguments: doxyparse.parse(arg)