Skip to content

Commit 317d603

Browse files
committed
fix some warnings while building docs
1 parent be2abd2 commit 317d603

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

docs/conf.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
13-
13+
from __future__ import print_function
1414
import sys, os
1515

1616
# If extensions (or modules to document with autodoc) are in another directory,
@@ -26,8 +26,11 @@
2626

2727
# Add any Sphinx extension module names here, as strings. They can be extensions
2828
# 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+
]
3134

3235
# Add any paths that contain templates here, relative to this directory.
3336
templates_path = ['_templates']
@@ -52,10 +55,8 @@
5255
try:
5356
release = pkg_resources.get_distribution('Flask').version
5457
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.')
5960
sys.exit(1)
6061
del pkg_resources
6162

@@ -258,13 +259,13 @@
258259
# fall back if theme is not there
259260
try:
260261
__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)
268269

269270
pygments_style = 'tango'
270271
html_theme = 'default'

docs/extensions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _extensions:
2+
13
Flask Extensions
24
================
35

docs/upgrading.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Version 1.0
2525
-----------
2626

2727
Debugging
28-
+++++++++
28+
`````````
2929

3030
Flask 1.0 removed the ``debug_log_format`` attribute from Flask
3131
applications. Instead the new ``LOGGER_HANDLER_POLICY`` configuration can
3232
be used to disable the default log handlers and custom log handlers can be
3333
set up.
3434

3535
Error handling
36-
++++++++++++++
36+
``````````````
3737

3838
The behavior of error handlers was changed.
3939
The precedence of handlers used to be based on the decoration/call order of
@@ -53,14 +53,14 @@ Trying to register a handler on an instance now raises :exc:`ValueError`.
5353
handlers only using exception classes and HTTP error codes.
5454

5555
Templating
56-
++++++++++
56+
``````````
5757

5858
The :func:`~flask.templating.render_template_string` function has changed to
5959
autoescape template variables by default. This better matches the behavior
6060
of :func:`~flask.templating.render_template`.
6161

6262
Extension imports
63-
+++++++++++++++++
63+
`````````````````
6464

6565
Extension imports of the form ``flask.ext.foo`` are deprecated, you should use
6666
``flask_foo``.

0 commit comments

Comments
 (0)