diff options
| author | Georg Brandl <georg@python.org> | 2011-01-04 11:29:09 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2011-01-04 11:29:09 +0100 |
| commit | 91f7f969ed843e4edd7c9f0a5403c2a9c9de9833 (patch) | |
| tree | 7c6e2469c3a80d9712519426a6263a2083088138 /sphinx/builders | |
| parent | 8a623b1e53df7c211a2b6989e187d1072377fd5b (diff) | |
| parent | 901ef024a6309d69bd4e04da2145b97af99cb64e (diff) | |
| download | sphinx-91f7f969ed843e4edd7c9f0a5403c2a9c9de9833.tar.gz | |
merge with 1.0
Diffstat (limited to 'sphinx/builders')
| -rw-r--r-- | sphinx/builders/__init__.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/changes.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/devhelp.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/epub.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/html.py | 39 | ||||
| -rw-r--r-- | sphinx/builders/htmlhelp.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/intl.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/latex.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/linkcheck.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/manpage.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/qthelp.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/texinfo.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/text.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/versioning.py | 2 | ||||
| -rw-r--r-- | sphinx/builders/websupport.py | 2 |
15 files changed, 34 insertions, 33 deletions
diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 1fe47407..d96ad58e 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -5,7 +5,7 @@ Builder superclass for all builders. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py index 488bc037..3e351e6c 100644 --- a/sphinx/builders/changes.py +++ b/sphinx/builders/changes.py @@ -5,7 +5,7 @@ Changelog builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py index d43cd624..a1b41945 100644 --- a/sphinx/builders/devhelp.py +++ b/sphinx/builders/devhelp.py @@ -7,7 +7,7 @@ .. _Devhelp: http://live.gnome.org/devhelp - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index 4731b92c..12896503 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -6,7 +6,7 @@ Build epub files. Originally derived from qthelp.py. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 947cc3a0..f2801499 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -5,7 +5,7 @@ Several HTML builders. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -103,15 +103,21 @@ class StandaloneHTMLBuilder(Builder): self.link_suffix = self.out_suffix if self.config.language is not None: - jsfile_list = [path.join(package_dir, 'locale', - self.config.language, 'LC_MESSAGES', 'sphinx.js'), - path.join(sys.prefix, 'share/sphinx/locale', - self.config.language, 'sphinx.js')] - - for jsfile in jsfile_list: - if path.isfile(jsfile): - self.script_files.append('_static/translations.js') - break + if self._get_translations_js(): + self.script_files.append('_static/translations.js') + + def _get_translations_js(self): + candidates = [path.join(package_dir, 'locale', self.config.language, + 'LC_MESSAGES', 'sphinx.js'), + path.join(sys.prefix, 'share/sphinx/locale', + self.config.language, 'sphinx.js')] + \ + [path.join(dir, self.config.language, + 'LC_MESSAGES', 'sphinx.js') + for dir in self.config.locale_dirs] + for jsfile in candidates: + if path.isfile(jsfile): + return jsfile + return None def get_theme_config(self): return self.config.html_theme, self.config.html_theme_options @@ -529,15 +535,10 @@ class StandaloneHTMLBuilder(Builder): f.close() # then, copy translations JavaScript file if self.config.language is not None: - jsfile_list = [path.join(package_dir, 'locale', - self.config.language, 'LC_MESSAGES', 'sphinx.js'), - path.join(sys.prefix, 'share/sphinx/locale', - self.config.language, 'sphinx.js')] - for jsfile in jsfile_list: - if path.isfile(jsfile): - copyfile(jsfile, path.join(self.outdir, '_static', - 'translations.js')) - break + jsfile = self._get_translations_js() + if jsfile: + copyfile(jsfile, path.join(self.outdir, '_static', + 'translations.js')) # then, copy over theme-supplied static files if self.theme: themeentries = [path.join(themepath, 'static') diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py index 79c2e605..9227a6e6 100644 --- a/sphinx/builders/htmlhelp.py +++ b/sphinx/builders/htmlhelp.py @@ -6,7 +6,7 @@ Build HTML help support files. Parts adapted from Python's Doc/tools/prechm.py. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/intl.py b/sphinx/builders/intl.py index 1572747e..447a20cf 100644 --- a/sphinx/builders/intl.py +++ b/sphinx/builders/intl.py @@ -5,7 +5,7 @@ The MessageCatalogBuilder class. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index b2a3c4e7..b00546a0 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -5,7 +5,7 @@ LaTeX builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index e4091986..ad15b55d 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -5,7 +5,7 @@ The CheckExternalLinksBuilder class. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py index 756e4732..93b56a01 100644 --- a/sphinx/builders/manpage.py +++ b/sphinx/builders/manpage.py @@ -5,7 +5,7 @@ Manual pages builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py index 69d2cebf..5598aad2 100644 --- a/sphinx/builders/qthelp.py +++ b/sphinx/builders/qthelp.py @@ -5,7 +5,7 @@ Build input files for the Qt collection generator. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/texinfo.py b/sphinx/builders/texinfo.py index b08c0cd6..9d8749a9 100644 --- a/sphinx/builders/texinfo.py +++ b/sphinx/builders/texinfo.py @@ -5,7 +5,7 @@ Texinfo builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/text.py b/sphinx/builders/text.py index 092a1d97..40fd3d79 100644 --- a/sphinx/builders/text.py +++ b/sphinx/builders/text.py @@ -5,7 +5,7 @@ Plain-text Sphinx builder. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/versioning.py b/sphinx/builders/versioning.py index f0646a82..8c6438c7 100644 --- a/sphinx/builders/versioning.py +++ b/sphinx/builders/versioning.py @@ -3,7 +3,7 @@ sphinx.builders.versioning ~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os diff --git a/sphinx/builders/websupport.py b/sphinx/builders/websupport.py index c883fdf1..5165bc19 100644 --- a/sphinx/builders/websupport.py +++ b/sphinx/builders/websupport.py @@ -5,7 +5,7 @@ Builder for the web support package. - :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ |
