|
10 | 10 | #
|
11 | 11 | # All configuration values have a default; values that are commented out
|
12 | 12 | # serve to show the default.
|
13 |
| - |
| 13 | +from __future__ import print_function |
14 | 14 | import sys, os
|
15 | 15 |
|
16 | 16 | # If extensions (or modules to document with autodoc) are in another directory,
|
|
26 | 26 |
|
27 | 27 | # Add any Sphinx extension module names here, as strings. They can be extensions
|
28 | 28 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
29 |
| -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', |
30 |
| - 'flaskdocext'] |
| 29 | +extensions = [ |
| 30 | + 'sphinx.ext.autodoc', |
| 31 | + 'sphinx.ext.intersphinx', |
| 32 | + 'flaskdocext' |
| 33 | +] |
31 | 34 |
|
32 | 35 | # Add any paths that contain templates here, relative to this directory.
|
33 | 36 | templates_path = ['_templates']
|
|
52 | 55 | try:
|
53 | 56 | release = pkg_resources.get_distribution('Flask').version
|
54 | 57 | except pkg_resources.DistributionNotFound:
|
55 |
| - print 'To build the documentation, The distribution information of Flask' |
56 |
| - print 'Has to be available. Either install the package into your' |
57 |
| - print 'development environment or run "setup.py develop" to setup the' |
58 |
| - print 'metadata. A virtualenv is recommended!' |
| 58 | + print('Flask must be installed to build the documentation.') |
| 59 | + print('Install from source using `pip install -e .` in a virtualenv.') |
59 | 60 | sys.exit(1)
|
60 | 61 | del pkg_resources
|
61 | 62 |
|
|
258 | 259 | # fall back if theme is not there
|
259 | 260 | try:
|
260 | 261 | __import__('flask_theme_support')
|
261 |
| -except ImportError, e: |
262 |
| - print '-' * 74 |
263 |
| - print 'Warning: Flask themes unavailable. Building with default theme' |
264 |
| - print 'If you want the Flask themes, run this command and build again:' |
265 |
| - print |
266 |
| - print ' git submodule update --init' |
267 |
| - print '-' * 74 |
| 262 | +except ImportError as e: |
| 263 | + print('-' * 74) |
| 264 | + print('Warning: Flask themes unavailable. Building with default theme') |
| 265 | + print('If you want the Flask themes, run this command and build again:') |
| 266 | + print() |
| 267 | + print(' git submodule update --init') |
| 268 | + print('-' * 74) |
268 | 269 |
|
269 | 270 | pygments_style = 'tango'
|
270 | 271 | html_theme = 'default'
|
|
0 commit comments