| | |
| | | # 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' |