summaryrefslogtreecommitdiff
path: root/docs/conf.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2014-05-05 23:48:51 -0400
committerChris McDonough <chrism@plope.com>2014-05-05 23:48:51 -0400
commit0caac0a0af78cd55df2e1f3c3c7fc5171dbfe849 (patch)
treea624aa38b3db1f7de58bb8bf9aaff4583cec28fd /docs/conf.py
parentba85e591d563ed654f492f7cab5ca492a32a86d7 (diff)
parent0117573edbc5dff565868187f8841859b3e36a51 (diff)
downloadpyramid-0caac0a0af78cd55df2e1f3c3c7fc5171dbfe849.tar.gz
pyramid-0caac0a0af78cd55df2e1f3c3c7fc5171dbfe849.tar.bz2
pyramid-0caac0a0af78cd55df2e1f3c3c7fc5171dbfe849.zip
Merge branch 'master' into redundant_totuorial_logging_config
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/docs/conf.py b/docs/conf.py
index a447c9968..eba776628 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -138,17 +138,21 @@ if book:
# Add and use Pylons theme
if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
from subprocess import call, Popen, PIPE
-
- p = Popen('which git', shell=True, stdout=PIPE)
cwd = os.getcwd()
- _themes = os.path.join(cwd, '_themes')
+ p = Popen('which git', shell=True, stdout=PIPE)
+ here = os.path.abspath(os.path.dirname(__file__))
+ parent = os.path.abspath(os.path.dirname(here))
+ _themes = os.path.join(here, '_themes')
git = p.stdout.read().strip()
- if not os.listdir(_themes):
- call([git, 'submodule', '--init'])
- else:
- call([git, 'submodule', 'update'])
-
- sys.path.append(os.path.abspath('_themes'))
+ try:
+ os.chdir(parent)
+ if not os.listdir(_themes):
+ call([git, 'submodule', '--init'])
+ else:
+ call([git, 'submodule', 'update'])
+ sys.path.append(_themes)
+ finally:
+ os.chdir(cwd)
html_theme_path = ['_themes']
html_theme = 'pyramid'