Description: Move static files outside site-packages so that they can be shared between different Python versions. Forwarded: not-needed Last-Update: 2011-01-10 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -15,7 +15,7 @@ __version__ = '1.0.7' __released__ = '1.0.7' # used when Sphinx builds its own docs -package_dir = path.abspath(path.dirname(__file__)) +package_dir = '/usr/share/sphinx/' if '+' in __version__ or 'pre' in __version__: # try to find out the changeset hash if checked out from hg, and append --- a/tests/run.py +++ b/tests/run.py @@ -14,7 +14,10 @@ from os import path # always test the sphinx package from this directory -sys.path.insert(0, path.join(path.dirname(__file__), path.pardir)) +sys.path.insert(0, path.abspath(path.join(path.dirname(__file__), path.pardir))) + +import sphinx +sphinx.package_dir = path.join(sys.path[0], 'sphinx') try: import nose --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -14,6 +14,7 @@ from os import path from cStringIO import StringIO +from sphinx import package_dir from sphinx.errors import PycodeError from sphinx.pycode import nodes from sphinx.pycode.pgen2 import driver, token, tokenize, parse, literals @@ -22,7 +23,7 @@ # load the Python grammar -_grammarfile = path.join(path.dirname(__file__), 'Grammar.txt') +_grammarfile = path.join(package_dir, 'pycode', 'Grammar.txt') pygrammar = driver.load_grammar(_grammarfile) pydriver = driver.Driver(pygrammar, convert=nodes.convert) --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -26,6 +26,7 @@ from jinja2 import FileSystemLoader, TemplateNotFound from jinja2.sandbox import SandboxedEnvironment +from sphinx import package_dir from sphinx.ext.autosummary import import_by_name, get_documenter from sphinx.jinja2glue import BuiltinTemplateLoader from sphinx.util.osutil import ensuredir @@ -76,7 +77,7 @@ sources = [os.path.join(base_path, filename) for filename in sources] # create our own templating environment - template_dirs = [os.path.join(os.path.dirname(__file__), 'templates')] + template_dirs = [os.path.join(package_dir, 'ext', 'autosummary', 'templates')] if builder is not None: # allow the user to override the templates template_loader = BuiltinTemplateLoader()