From: Vladimír Vondruš Date: Mon, 10 Jan 2022 17:40:58 +0000 (+0100) Subject: documentation/doxygen: adapt to different \dotfile handling in 1.9.3. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=e92be04edd123e40bab367be5ef6604fe1acbbd9;p=blog.git documentation/doxygen: adapt to different \dotfile handling in 1.9.3. --- diff --git a/documentation/doxygen.py b/documentation/doxygen.py index f2b74dc7..d293940e 100755 --- a/documentation/doxygen.py +++ b/documentation/doxygen.py @@ -1052,7 +1052,12 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. caption = None if i.tag == 'dotfile': if 'name' in i.attrib: - with open(i.attrib['name'], 'r') as f: + # Since 1.9.3, the file is copied to the XML output + # directory and name contains its relative path. Before + # that, the name was absolute, os.path.join() should do the + # right thing in both cases. + path = os.path.join(state.basedir, state.doxyfile['OUTPUT_DIRECTORY'], state.doxyfile['XML_OUTPUT'], i.attrib['name']) + with open(path, 'r') as f: source = f.read() # Since 1.8.16 the whole tag is dropped if the file # doesn't exist. Such a great solution that it's unfathomable.