From 060b1eb1e38b294495adab784da32ca4e9871d20 Mon Sep 17 00:00:00 2001 From: Ben Kaduk Date: Wed, 12 Dec 2012 13:23:03 -0500 Subject: Better names for doxygen-Sphinx bridge functions It is confusing when the codepath for the production doc build involves calling functions with names like "test". Rename things which are in active use so that routines which are actually only used for testing are more discernable as such. ticket: 7505 (new) tags: pullup target_version: 1.11 --- doc/tools/doxy.py | 8 ++++---- doc/tools/doxybuilder_funcs.py | 19 ++++++++----------- doc/tools/doxybuilder_types.py | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/doc/tools/doxy.py b/doc/tools/doxy.py index c8a4b9dad..c82f88eb7 100644 --- a/doc/tools/doxy.py +++ b/doc/tools/doxy.py @@ -50,12 +50,12 @@ def processOptions(): parser.error("Input and output directories are required") if action == "all" or action == "typedef": - tester = DoxyTypesTest(in_dir, out_dir) - tester.run_tests() + builder = DoxyBuilderTypes(in_dir, out_dir) + builder.run_all() if action == "all" or action == "func" or action == "function": - tester = DoxyFuncsTest(in_dir, out_dir) - tester.run_tests() + builder = DoxyBuilderFuncs(in_dir, out_dir) + builder.run_all() if __name__ == '__main__': diff --git a/doc/tools/doxybuilder_funcs.py b/doc/tools/doxybuilder_funcs.py index c9b690185..bfcadfdf2 100644 --- a/doc/tools/doxybuilder_funcs.py +++ b/doc/tools/doxybuilder_funcs.py @@ -573,25 +573,22 @@ class DoxyFuncs(XML2AST): -class DoxyFuncsTest(DoxyFuncs): +class DoxyBuilderFuncs(DoxyFuncs): def __init__(self, xmlpath, rstpath): - super(DoxyFuncsTest,self).__init__(xmlpath) + super(DoxyBuilderFuncs,self).__init__(xmlpath) self.target_dir = rstpath outfile = '%s/%s' % (self.target_dir, 'out.txt') self.tmp = open(outfile, 'w') - def run_tests(self): - self.test_save() - - def test_run(self): - self.run() - - def test_save(self): + def run_all(self): self.run() templates = {'function': 'func_document.tmpl'} self.save(templates, self.target_dir) + def test_run(self): + self.run() + if __name__ == '__main__': - tester = DoxyFuncsTest(xmlpath, rstpath) - tester.run_tests() + builder = DoxyBuilderFuncs(xmlpath, rstpath) + builder.run_all() diff --git a/doc/tools/doxybuilder_types.py b/doc/tools/doxybuilder_types.py index 5e55391d8..0774f34e3 100644 --- a/doc/tools/doxybuilder_types.py +++ b/doc/tools/doxybuilder_types.py @@ -326,26 +326,26 @@ class DoxyTypes(object): -class DoxyTypesTest(DoxyTypes): +class DoxyBuilderTypes(DoxyTypes): def __init__(self, xmlpath, rstpath): self.templates = { 'composite': 'type_document.tmpl'} self.target_dir = rstpath - super(DoxyTypesTest,self).__init__(xmlpath) + super(DoxyBuilderTypes,self).__init__(xmlpath) - def run_tests(self): - self.test_process_typedef_node() - self.test_process_define_node() + def run_all(self): + self.process_typedef_nodes() + self.process_define_nodes() def test_run(self): filename = 'krb5_8hin.xml' self.run(filename) - def test_process_variable_node(self): + def process_variable_nodes(self): filename = 'struct__krb5__octet__data.xml' result = self.run(filename, include=['variable']) - def test_process_typedef_node(self): + def process_typedef_nodes(self): # run parser for typedefs filename = 'krb5_8hin.xml' result = self.run(filename, include=['typedef']) @@ -356,7 +356,7 @@ class DoxyTypesTest(DoxyTypes): obj = DocModel(**t) self.save(obj, self.templates, target_dir) - def test_process_define_node(self): + def process_define_nodes(self): # run parser for define's filename = 'krb5_8hin.xml' result = self.run(filename, include=['define']) @@ -370,5 +370,5 @@ class DoxyTypesTest(DoxyTypes): if __name__ == '__main__': - tester = DoxyTypesTest( xml_inpath, rst_outpath) - tester.run_tests() + builder = DoxyBuilderTypes( xml_inpath, rst_outpath) + builder.run_all() -- cgit