From a5d0cabc7552fecc77ab2aa3a1b87d7cbe04ebd5 Mon Sep 17 00:00:00 2001 From: Zak Johnson Date: Mon, 21 Apr 2014 15:37:23 -0700 Subject: [PATCH 01/13] Fix typos in docstrings and comments in run.py --- flask/run.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flask/run.py b/flask/run.py index 9d86df02..d16b3e0a 100644 --- a/flask/run.py +++ b/flask/run.py @@ -30,7 +30,7 @@ def find_best_app(module): if app is not None and callable(app): return app - # Otherwise find the first object named Flask + # Otherwise find exactly one Flask instance, or fail. matches = [] for key, value in iteritems(module.__dict__): if isinstance(value, Flask): @@ -52,7 +52,7 @@ def find_best_app(module): def prepare_exec_for_file(filename): module = [] - # Chop off file extensions or package markers + # Chop off file extensions or package markers. if filename.endswith('.py'): filename = filename[:-3] elif os.path.split(filename)[1] == '__init__.py': @@ -93,10 +93,10 @@ def locate_app(app_id, debug=None): class DispatchingApp(object): - """Special applicationt that dispatches to a flask application which + """Special application that dispatches to a flask application which is imported by name on first request. This is safer than importing - the application upfront because it means that we can forward all - errors for import problems into the browser as error. + the application up front because it means that we can forward all + errors for import problems into the browser as errors. """ def __init__(self, app_id, debug=None, use_eager_loading=False): @@ -127,7 +127,7 @@ def run_application(app_id, host='127.0.0.1', port=5000, debug=None, use_eager_loading=None, magic_app_id=True, **options): """Useful function to start a Werkzeug server for an application that - is known by it's import name. By default the app ID can also be a + is known by its import name. By default the app ID can also be a full file name in which case Flask attempts to reconstruct the import name from it and do the right thing. @@ -159,7 +159,7 @@ def run_application(app_id, host='127.0.0.1', port=5000, debug=None, if use_eager_loading is None: use_eager_loading = not use_reloader - # Extra startup messages. This depends a but on Werkzeug internals to + # Extra startup messages. This depends a bit on Werkzeug internals to # not double execute when the reloader kicks in. if os.environ.get('WERKZEUG_RUN_MAIN') != 'true': print ' * Serving Flask app "%s"' % app_id From 02848ef66bb58afd3306d38c9c3afa79219ab17f Mon Sep 17 00:00:00 2001 From: "Carlos E. Garcia" Date: Wed, 23 Apr 2014 10:46:38 -0400 Subject: [PATCH 02/13] few mispelling errors --- docs/tutorial/dbcon.rst | 2 +- flask/_compat.py | 2 +- flask/helpers.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/dbcon.rst b/docs/tutorial/dbcon.rst index fb5a0c4a..0e3f7de5 100644 --- a/docs/tutorial/dbcon.rst +++ b/docs/tutorial/dbcon.rst @@ -53,7 +53,7 @@ every time the app context tears down. So what does this mean? Essentially the app context is created before the request comes in and is destroyed (teared down) whenever the request finishes. A teardown can happen because of two reasons: either everything went well (the error -parameter will be `None`) or an exception happend in which case the error +parameter will be `None`) or an exception happened in which case the error is passed to the teardown function. Curious about what these contexts mean? Have a look at the diff --git a/flask/_compat.py b/flask/_compat.py index 86a87832..d4ec9839 100644 --- a/flask/_compat.py +++ b/flask/_compat.py @@ -77,7 +77,7 @@ def with_metaclass(meta, *bases): # breaks the __exit__ function in a very peculiar way. This is currently # true for pypy 2.2.1 for instance. The second level of exception blocks # is necessary because pypy seems to forget to check if an exception -# happend until the next bytecode instruction? +# happened until the next bytecode instruction? BROKEN_PYPY_CTXMGR_EXIT = False if hasattr(sys, 'pypy_version_info'): class _Mgr(object): diff --git a/flask/helpers.py b/flask/helpers.py index 920c4c87..77148708 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -662,7 +662,7 @@ def get_root_path(import_name): 'module came from an import hook that does ' 'not provide file name information or because ' 'it\'s a namespace package. In this case ' - 'the root path needs to be explictly ' + 'the root path needs to be explicitly ' 'provided.' % import_name) # filepath is import_name.py for a module, or __init__.py for a package. From 6e1a507061a8a4b8ea75669d1c5514f8cefe0966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:13:19 +0200 Subject: [PATCH 03/13] Check links in the documentation with tox --- tox.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b09458d9..ceb42b6d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,11 @@ [tox] -envlist = py26, py27, pypy, py33 +envlist = docs, py26, py27, pypy, py33 [testenv] deps = blinker commands = python run-tests.py [] + + +[testenv:docs] +deps = sphinx +commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/linkcheck From a698884319314c1a7efc83827eb459fe47cc209e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:20:12 +0200 Subject: [PATCH 04/13] Fix Pocoo documentation links --- docs/index.rst | 6 +++--- docs/installation.rst | 2 +- docs/quickstart.rst | 4 ++-- docs/templating.rst | 2 +- docs/tutorial/templates.rst | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 43702409..617104ee 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,11 +21,11 @@ engine and the `Werkzeug`_ WSGI toolkit. These libraries are not documented here. If you want to dive into their documentation, check out the following links: -- `Jinja2 Documentation `_ -- `Werkzeug Documentation `_ +- `Jinja2 Documentation `_ +- `Werkzeug Documentation `_ -.. _Jinja2: http://jinja.pocoo.org/2/ +.. _Jinja2: http://jinja.pocoo.org/ .. _Werkzeug: http://werkzeug.pocoo.org/ .. include:: contents.rst.inc diff --git a/docs/installation.rst b/docs/installation.rst index 78f192fd..163782f2 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -4,7 +4,7 @@ Installation ============ Flask depends on some external libraries, like `Werkzeug -`_ and `Jinja2 `_. +`_ and `Jinja2 `_. Werkzeug is a toolkit for WSGI, the standard Python interface between web applications and a variety of servers for both development and deployment. Jinja2 renders templates. diff --git a/docs/quickstart.rst b/docs/quickstart.rst index a4494f43..05e27e74 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -347,7 +347,7 @@ Rendering Templates Generating HTML from within Python is not fun, and actually pretty cumbersome because you have to do the HTML escaping on your own to keep the application secure. Because of that Flask configures the `Jinja2 -`_ template engine for you automatically. +`_ template engine for you automatically. To render a template you can use the :func:`~flask.render_template` method. All you have to do is provide the name of the template and the @@ -380,7 +380,7 @@ package it's actually inside your package: For templates you can use the full power of Jinja2 templates. Head over to the official `Jinja2 Template Documentation -`_ for more information. +`_ for more information. Here is an example template: diff --git a/docs/templating.rst b/docs/templating.rst index 4e432333..bf672672 100644 --- a/docs/templating.rst +++ b/docs/templating.rst @@ -9,7 +9,7 @@ An extension can depend on Jinja2 being present. This section only gives a very quick introduction into how Jinja2 is integrated into Flask. If you want information on the template engine's syntax itself, head over to the official `Jinja2 Template -Documentation `_ for +Documentation `_ for more information. Jinja Setup diff --git a/docs/tutorial/templates.rst b/docs/tutorial/templates.rst index 5ec5584d..fd3abe68 100644 --- a/docs/tutorial/templates.rst +++ b/docs/tutorial/templates.rst @@ -16,7 +16,7 @@ the layout of the website in all pages. Put the following templates into the `templates` folder: -.. _Jinja2: http://jinja.pocoo.org/2/documentation/templates +.. _Jinja2: http://jinja.pocoo.org/docs/templates layout.html ----------- From e18b85a2409e2443c8a0918189b059f813a38acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:24:07 +0200 Subject: [PATCH 05/13] Link to https version of python docs To which the http version permanently redirects --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 16c841f4..524ee555 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -244,7 +244,7 @@ latex_additional_files = ['flaskstyle.sty', 'logo.pdf'] #epub_tocdepth = 3 intersphinx_mapping = { - 'http://docs.python.org/dev': None, + 'https://docs.python.org/dev': None, 'http://werkzeug.pocoo.org/docs/': None, 'http://www.sqlalchemy.org/docs/': None, 'http://wtforms.simplecodes.com/docs/0.5/': None, From f9b12aa0ad4d7fc8ba7c26e371a89802d6246db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:26:12 +0200 Subject: [PATCH 06/13] Fix Jinja link --- docs/tutorial/folders.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/folders.rst b/docs/tutorial/folders.rst index 4bf47cd7..e1ff229d 100644 --- a/docs/tutorial/folders.rst +++ b/docs/tutorial/folders.rst @@ -20,4 +20,4 @@ templates you create later in the tutorial will go in this directory. Continue with :ref:`tutorial-schema`. -.. _Jinja2: http://jinja.pocoo.org/2/ +.. _Jinja2: http://jinja.pocoo.org/ From 8399008e914e20f2f6e64022e76a57d1da730fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:30:28 +0200 Subject: [PATCH 07/13] Switch pypi links to https To which the http version redirects permanently --- CHANGES | 2 +- docs/api.rst | 2 +- docs/deploying/mod_wsgi.rst | 2 +- docs/patterns/caching.rst | 2 +- docs/patterns/distribute.rst | 4 ++-- docs/patterns/sqlalchemy.rst | 2 +- docs/patterns/wtforms.rst | 2 +- docs/signals.rst | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 80c4b27d..86f588cf 100644 --- a/CHANGES +++ b/CHANGES @@ -400,7 +400,7 @@ Released on July 27th 2010, codename Whisky prefix. This makes it possible to bind a whole module to a configurable subdomain. -.. _blinker: http://pypi.python.org/pypi/blinker +.. _blinker: https://pypi.python.org/pypi/blinker Version 0.5.2 ------------- diff --git a/docs/api.rst b/docs/api.rst index c87055d1..6c9f7414 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -597,7 +597,7 @@ Signals do nothing but will fail with a :exc:`RuntimeError` for all other operations, including connecting. -.. _blinker: http://pypi.python.org/pypi/blinker +.. _blinker: https://pypi.python.org/pypi/blinker Class-Based Views ----------------- diff --git a/docs/deploying/mod_wsgi.rst b/docs/deploying/mod_wsgi.rst index 8fd2c0bb..baac5a1b 100644 --- a/docs/deploying/mod_wsgi.rst +++ b/docs/deploying/mod_wsgi.rst @@ -109,7 +109,7 @@ For more information consult the `mod_wsgi wiki`_. .. _mod_wsgi: http://code.google.com/p/modwsgi/ .. _installation instructions: http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide -.. _virtual python: http://pypi.python.org/pypi/virtualenv +.. _virtual python: https://pypi.python.org/pypi/virtualenv .. _mod_wsgi wiki: http://code.google.com/p/modwsgi/wiki/ Troubleshooting diff --git a/docs/patterns/caching.rst b/docs/patterns/caching.rst index 5817aa29..a0633cf9 100644 --- a/docs/patterns/caching.rst +++ b/docs/patterns/caching.rst @@ -27,7 +27,7 @@ cache that keeps the item stored in the memory of the Python interpreter:: cache = SimpleCache() If you want to use memcached, make sure to have one of the memcache modules -supported (you get them from `PyPI `_) and a +supported (you get them from `PyPI `_) and a memcached server running somewhere. This is how you connect to such an memcached server then:: diff --git a/docs/patterns/distribute.rst b/docs/patterns/distribute.rst index b6f6a5ef..aa53e685 100644 --- a/docs/patterns/distribute.rst +++ b/docs/patterns/distribute.rst @@ -161,6 +161,6 @@ folder instead of copying the data over. You can then continue to work on the code without having to run `install` again after each change. -.. _distribute: http://pypi.python.org/pypi/distribute -.. _pip: http://pypi.python.org/pypi/pip +.. _distribute: https://pypi.python.org/pypi/distribute +.. _pip: https://pypi.python.org/pypi/pip .. _distribute_setup.py: http://python-distribute.org/distribute_setup.py diff --git a/docs/patterns/sqlalchemy.rst b/docs/patterns/sqlalchemy.rst index 3c4d9ce9..dd0eee91 100644 --- a/docs/patterns/sqlalchemy.rst +++ b/docs/patterns/sqlalchemy.rst @@ -20,7 +20,7 @@ there is a Flask extension that handles that for you. This is recommended if you want to get started quickly. You can download `Flask-SQLAlchemy`_ from `PyPI -`_. +`_. .. _Flask-SQLAlchemy: http://packages.python.org/Flask-SQLAlchemy/ diff --git a/docs/patterns/wtforms.rst b/docs/patterns/wtforms.rst index 1bf46637..005efebb 100644 --- a/docs/patterns/wtforms.rst +++ b/docs/patterns/wtforms.rst @@ -17,7 +17,7 @@ forms. The `Flask-WTF`_ extension expands on this pattern and adds a few handful little helpers that make working with forms and Flask more fun. You can get it from `PyPI - `_. + `_. .. _Flask-WTF: http://packages.python.org/Flask-WTF/ diff --git a/docs/signals.rst b/docs/signals.rst index c9df1edf..46342033 100644 --- a/docs/signals.rst +++ b/docs/signals.rst @@ -349,4 +349,4 @@ The following signals exist in Flask: .. versionadded:: 0.10 -.. _blinker: http://pypi.python.org/pypi/blinker +.. _blinker: https://pypi.python.org/pypi/blinker From 1973eb22a3939a6a3117de220bc07f9b536c3176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:35:37 +0200 Subject: [PATCH 08/13] Switch packages.python.org to pythonhosted.org --- docs/extensiondev.rst | 2 +- docs/patterns/fileuploads.rst | 2 +- docs/patterns/sqlalchemy.rst | 2 +- docs/patterns/wtforms.rst | 4 ++-- docs/upgrading.rst | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/extensiondev.rst b/docs/extensiondev.rst index 09bf2d2c..4e0e45d8 100644 --- a/docs/extensiondev.rst +++ b/docs/extensiondev.rst @@ -415,6 +415,6 @@ instead of ``flask_foo`` or ``flaskext_foo`` so that extensions can transition to the new package name without affecting users. -.. _OAuth extension: http://packages.python.org/Flask-OAuth/ +.. _OAuth extension: http://pythonhosted.org/Flask-OAuth/ .. _mailinglist: http://flask.pocoo.org/mailinglist/ .. _IRC channel: http://flask.pocoo.org/community/irc/ diff --git a/docs/patterns/fileuploads.rst b/docs/patterns/fileuploads.rst index eef50a9a..74cdd98b 100644 --- a/docs/patterns/fileuploads.rst +++ b/docs/patterns/fileuploads.rst @@ -178,4 +178,4 @@ applications dealing with uploads, there is a Flask extension called `Flask-Uploads`_ that implements a full fledged upload mechanism with white and blacklisting of extensions and more. -.. _Flask-Uploads: http://packages.python.org/Flask-Uploads/ +.. _Flask-Uploads: http://pythonhosted.org/Flask-Uploads/ diff --git a/docs/patterns/sqlalchemy.rst b/docs/patterns/sqlalchemy.rst index dd0eee91..3b517a6d 100644 --- a/docs/patterns/sqlalchemy.rst +++ b/docs/patterns/sqlalchemy.rst @@ -22,7 +22,7 @@ if you want to get started quickly. You can download `Flask-SQLAlchemy`_ from `PyPI `_. -.. _Flask-SQLAlchemy: http://packages.python.org/Flask-SQLAlchemy/ +.. _Flask-SQLAlchemy: http://pythonhosted.org/Flask-SQLAlchemy/ Declarative diff --git a/docs/patterns/wtforms.rst b/docs/patterns/wtforms.rst index 005efebb..8017aea5 100644 --- a/docs/patterns/wtforms.rst +++ b/docs/patterns/wtforms.rst @@ -8,7 +8,7 @@ will handle here. If you find yourself in the situation of having many forms, you might want to give it a try. When you are working with WTForms you have to define your forms as classes -first. I recommend breaking up the application into multiple modules +first. I recommend breaking up the application into multiple modules (:ref:`larger-applications`) for that and adding a separate module for the forms. @@ -19,7 +19,7 @@ forms. fun. You can get it from `PyPI `_. -.. _Flask-WTF: http://packages.python.org/Flask-WTF/ +.. _Flask-WTF: http://pythonhosted.org/Flask-WTF/ The Forms --------- diff --git a/docs/upgrading.rst b/docs/upgrading.rst index ebea0101..ccfa82ad 100644 --- a/docs/upgrading.rst +++ b/docs/upgrading.rst @@ -43,7 +43,7 @@ when there is no request context yet but an application context. The old ``flask.Flask.request_globals_class`` attribute was renamed to :attr:`flask.Flask.app_ctx_globals_class`. -.. _Flask-OldSessions: http://packages.python.org/Flask-OldSessions/ +.. _Flask-OldSessions: http://pythonhosted.org/Flask-OldSessions/ Version 0.9 ----------- From 2c7da6ac763418a15986e930a86d1c7da6080481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:36:36 +0200 Subject: [PATCH 09/13] Use https instead of http for docs.python.org --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 05e27e74..930a2f0c 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -818,7 +818,7 @@ Here are some example log calls:: The attached :attr:`~flask.Flask.logger` is a standard logging :class:`~logging.Logger`, so head over to the official `logging -documentation `_ for more +documentation `_ for more information. Hooking in WSGI Middlewares From 6f2203b85ec5e2708c9dc2ba0581d1d7f37803c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:37:19 +0200 Subject: [PATCH 10/13] Use https for devcenter.heroku.com --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 930a2f0c..47d85ad5 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -841,7 +841,7 @@ Ready to deploy your new Flask app? To wrap up the quickstart, you can immediately deploy to a hosted platform, all of which offer a free plan for small projects: -- `Deploying Flask on Heroku `_ +- `Deploying Flask on Heroku `_ - `Deploying WSGI on dotCloud `_ with `Flask-specific notes `_ From cead159bf94c5b74909422a623747ed532be7297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:38:20 +0200 Subject: [PATCH 11/13] Use libevent.org --- docs/deploying/wsgi-standalone.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deploying/wsgi-standalone.rst b/docs/deploying/wsgi-standalone.rst index c8d4f20e..11d07831 100644 --- a/docs/deploying/wsgi-standalone.rst +++ b/docs/deploying/wsgi-standalone.rst @@ -64,7 +64,7 @@ event loop:: .. _Gevent: http://www.gevent.org/ .. _greenlet: http://greenlet.readthedocs.org/en/latest/ -.. _libevent: http://monkey.org/~provos/libevent/ +.. _libevent: http://libevent.org/ Twisted Web ----------- From d2c3b46b76aea86a6b7cc4fca193dc862a8831f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:39:22 +0200 Subject: [PATCH 12/13] Switch diveintohtml5.org to diveintohtml5.info --- docs/htmlfaq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/htmlfaq.rst b/docs/htmlfaq.rst index b16f4cd5..434bb656 100644 --- a/docs/htmlfaq.rst +++ b/docs/htmlfaq.rst @@ -186,7 +186,7 @@ Many other features have been added, as well. A good guide to new features in HTML5 is Mark Pilgrim's soon-to-be-published book, `Dive Into HTML5`_. Not all of them are supported in browsers yet, however, so use caution. -.. _Dive Into HTML5: http://www.diveintohtml5.org/ +.. _Dive Into HTML5: http://www.diveintohtml5.info/ What should be used? -------------------- From baa95c6be378230592961ff3fc017f9175a61051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuha=CC=88user?= Date: Sat, 26 Apr 2014 01:45:20 +0200 Subject: [PATCH 13/13] Run tests with Python 3.4 with tox --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ceb42b6d..24155a9a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = docs, py26, py27, pypy, py33 +envlist = docs, py26, py27, pypy, py33, py34 [testenv] deps = blinker