From: Vladimír Vondruš Date: Wed, 6 Dec 2017 20:56:01 +0000 (+0100) Subject: doxygen: don't overwrite stuff from included Doxyfiles. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=e7bca0a377d7ca60fc4c1b1a127343a6200050f3;p=blog.git doxygen: don't overwrite stuff from included Doxyfiles. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index f4aa4f53..f7c78fb1 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1485,7 +1485,7 @@ def parse_index_xml(state: State, xml): return parsed -def parse_doxyfile(state: State, doxyfile): +def parse_doxyfile(state: State, doxyfile, config = None): logging.info("Parsing configuration from {}".format(doxyfile)) comment_re = re.compile(r"""^\s*(#.*)?$""") @@ -1497,7 +1497,7 @@ def parse_doxyfile(state: State, doxyfile): # user-provided Doxygen can append to them. They are later converted to # string or kept as a list based on type, so all have to be a list of # strings now. - config = { + if not config: config = { 'PROJECT_NAME': ['My Project'], 'OUTPUT_DIRECTORY': [''], 'XML_OUTPUT': ['xml'], @@ -1557,7 +1557,7 @@ def parse_doxyfile(state: State, doxyfile): # Another file included, parse it if key == '@INCLUDE': - parse_doxyfile(state, os.path.join(os.path.dirname(doxyfile), ' '.join(value))) + parse_doxyfile(state, os.path.join(os.path.dirname(doxyfile), ' '.join(value)), config) assert not backslash else: config[key] = value diff --git a/doxygen/test/doxyfile/Doxyfile-another b/doxygen/test/doxyfile/Doxyfile-another index c030d17b..d5e216c8 100644 --- a/doxygen/test/doxyfile/Doxyfile-another +++ b/doxygen/test/doxyfile/Doxyfile-another @@ -1 +1 @@ -PROJECT_NAME = "My Project" +PROJECT_NAME = "My Pet Project" diff --git a/doxygen/test/test_doxyfile.py b/doxygen/test/test_doxyfile.py index e33a6ff6..f492bff1 100644 --- a/doxygen/test/test_doxyfile.py +++ b/doxygen/test/test_doxyfile.py @@ -17,6 +17,6 @@ class Doxyfile(unittest.TestCase): 'M_THEME_COLOR': '#22272e', 'OUTPUT_DIRECTORY': '', 'PROJECT_BRIEF': 'is cool', - 'PROJECT_NAME': 'My Project', + 'PROJECT_NAME': 'My Pet Project', 'XML_OUTPUT': 'xml' })