fix some warnings while building docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent be2abd2 · Browse files · 3 files·+21 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+21 added−18 removed
- other:+21 added−18 removed
Provenance
- Commit
317d603- Tree
2b63801- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
be2abd2
3 files changed+21 added−18 removed
modified:docs/conf.py+15 added-14 removed
8 unmodified lines9 # autogenerated file.10 #11 # All configuration values have a default; values that are commented out12 # serve to show the default.13-13+from __future__ import print_function14 import sys, os15 16 # If extensions (or modules to document with autodoc) are in another directory,17 # add these directories to sys.path here. If the directory is relative to the7 unmodified lines25 #needs_sphinx = '1.0'26 27 # Add any Sphinx extension module names here, as strings. They can be extensions28 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.29+extensions = [30+ 'sphinx.ext.autodoc',29-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx',30- 'flaskdocext']31+ 'sphinx.ext.intersphinx',32+ 'flaskdocext'33+]34 35 # Add any paths that contain templates here, relative to this directory.36 templates_path = ['_templates']37 16 unmodified lines54 import pkg_resources55 try:56 release = pkg_resources.get_distribution('Flask').version57 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.')60 sys.exit(1)61 del pkg_resources62 63 if 'dev' in release:194 unmodified lines258 259 # fall back if theme is not there260 try:261 __import__('flask_theme_support')261-except ImportError, e:262- print '-' * 74263- print 'Warning: Flask themes unavailable. Building with default theme'264- print 'If you want the Flask themes, run this command and build again:'265- print266- print ' git submodule update --init'267- print '-' * 74262+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)269 270 pygments_style = 'tango'271 html_theme = 'default'272 html_theme_options = {}21 unmodified linesmodified:docs/extensions.rst+2 added
1+.. _extensions:2+3 Flask Extensions4 ================5 6 Flask extensions extend the functionality of Flask in various different45 unmodified linesmodified:docs/upgrading.rst+4 added-4 removed
23 unmodified lines24 Version 1.025 -----------26 27 Debugging28-+++++++++28+`````````29 30 Flask 1.0 removed the ``debug_log_format`` attribute from Flask31 applications. Instead the new ``LOGGER_HANDLER_POLICY`` configuration can32 be used to disable the default log handlers and custom log handlers can be33 set up.34 35 Error handling36-++++++++++++++36+``````````````37 38 The behavior of error handlers was changed.39 The precedence of handlers used to be based on the decoration/call order of40 :meth:`~flask.Flask.errorhandler` and11 unmodified lines52 and therefore was replaced with the intended behavior of registering53 handlers only using exception classes and HTTP error codes.54 55 Templating56-++++++++++56+``````````57 58 The :func:`~flask.templating.render_template_string` function has changed to59 autoescape template variables by default. This better matches the behavior60 of :func:`~flask.templating.render_template`.61 62 Extension imports63-+++++++++++++++++63+`````````````````64 65 Extension imports of the form ``flask.ext.foo`` are deprecated, you should use66 ``flask_foo``.67 357 unmodified lines