From 7dc13f1e2b69b9c8d856cd4e6c6b142b1c433913 Mon Sep 17 00:00:00 2001 From: Andrea Gavana Date: Sat, 8 Dec 2012 15:11:14 +0000 Subject: [PATCH] Work around for the buildbot sphinx generator which seems unable to find tables and snippets (hopefully this will do the job)... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- etgtools/sphinx_generator.py | 6 +++++- sphinxtools/utilities.py | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index b3f5b904..326884dc 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1287,7 +1287,11 @@ class Table(Node): possible_rest_input = os.path.join(TABLEROOT, self.xml_item_name) if os.path.isfile(possible_rest_input): - table = '\n\n' + spacer + '.. include:: %s\n\n'%possible_rest_input + # Work around for the buildbot sphinx generator which seems unable + # to find the tables... + rst_file = os.path.split(possible_rest_input)[1] + rst_folder = os.path.normpath(os.path.relpath(TABLEROOT, SPHINXROOT)) + table = '\n\n' + spacer + '.. include:: %s\n\n'%os.path.join(rst_folder, rst_file) if self.element.tail and self.element.tail.strip(): rest = ConvertToPython(self.element.tail.rstrip()) diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index 20913a42..397e9a6d 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -784,20 +784,20 @@ def FormatContributedSnippets(kind, contrib_snippets): user = lines[0].replace('##', '').strip() onlyfile = os.path.split(snippet)[1] + download = os.path.join(SPHINXROOT, '_downloads', onlyfile) + if not os.path.isfile(download): + shutil.copyfile(snippet, download) + text += RAW_1%(spacer, spacer) text += '\n' + spacer + 'Example %d - %s (:download:`download <_downloads/%s>`):\n\n'%(indx+1, user, onlyfile) - text += spacer + '.. literalinclude:: %s\n'%snippet + text += spacer + '.. literalinclude:: _downloads/%s\n'%onlyfile text += spacer + ' :lines: 2-\n\n' text += RAW_2%(spacer, spacer) text += '\n\n%s|\n\n'%spacer - download = os.path.join(SPHINXROOT, '_downloads', onlyfile) - if not os.path.isfile(download): - shutil.copyfile(snippet, download) - return text