Permalink
Browse files

added an rtd hack to update the themes submodule

  • Loading branch information...
1 parent b51043a commit 5bbb2d6cdbfa43a624d193f07e13c5522e095d9b @blaflamme blaflamme committed May 6, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 conf.py
View
@@ -97,6 +97,18 @@
# -- Options for HTML output ---------------------------------------------------
+if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
+ from subprocess import call, Popen, PIPE
+
+ cwd = os.getcwd()
+ _themes = os.path.join(cwd, '_themes')
+ p = Popen('which git', shell=True, stdout=PIPE)
+ git = p.stdout.read().strip()
+ if not os.listdir(_themes):
+ call([git, 'submodule', '--init'])
+ else:
+ call([git, 'submodule', 'update'])
+
# Add and use Pylons theme
sys.path.append(os.path.abspath('_themes'))
html_theme_path = ['_themes']

0 comments on commit 5bbb2d6

Please sign in to comment.