Merge pull request #1225 from s3rvac/typo-and-cosmetic-fixes
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Typo and cosmetic fixes
authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents fe2d75e, d4f6734 · Browse files · 19 files·+26 added−28 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
19 files+26 added−28 removed
- tests:+4 added−6 removed
- other:+22 added−22 removed
Provenance
- Commit
84efebd- Tree
147d91b- Author
Markus Unterwaditzer <markus@unterwaditzer.net>- Committer
Markus Unterwaditzer <markus@unterwaditzer.net>- Parent 1
fe2d75e- Parent 2
d4f6734
19 files changed+26 added−28 removed
modified:docs/patterns/fabric.rst+2 added-2 removed
30 unmodified lines31 hosts. These hosts can be defined either in the fabfile or on the command32 line. In this case we will add them to the fabfile.33 34 This is a basic first example that has the ability to upload the current35-sourcecode to the server and install it into a pre-existing35+source code to the server and install it into a pre-existing36 virtual environment::37 38 from fabric.api import *39 145 unmodified lines185 - You could also put your application code into a repository and check186 out the latest version on the server and then install. That way you187 can also easily go back to older versions.188 - hook in testing functionality so that you can deploy to an external189- server and run the testsuite.189+ server and run the test suite.190 191 Working with Fabric is fun and you will notice that it's quite magical to192 type ``fab deploy`` and see your application being deployed automatically193 to one or more remote servers.3 unmodified linesmodified:docs/tutorial/index.rst+1 added-1 removed
9 unmodified lines10 features everything you need to get started. We will use Flask and SQLite11 as database which comes out of the box with Python, so there is nothing12 else you need.13 14-If you want the full sourcecode in advance or for comparison, check out14+If you want the full source code in advance or for comparison, check out15 the `example source`_.16 17 .. _example source:18 https://github.com/mitsuhiko/flask/tree/master/examples/flaskr/14 unmodified linesmodified:docs/license.rst+1 added-1 removed
24 unmodified lines25 26 - "AUTHORS" hereby refers to all the authors listed in the27 :ref:`authors` section.28 29-- The ":ref:`flask-license`" applies to all the sourcecode shipped as29+- The ":ref:`flask-license`" applies to all the source code shipped as30 part of Flask (Flask itself as well as the examples and the unittests)31 as well as documentation.32 33 - The ":ref:`artwork-license`" applies to the project's Horn-Logo.15 unmodified linesmodified:docs/quickstart.rst+1 added-1 removed
220 unmodified lines221 222 Though they look rather similar, they differ in their use of the trailing223 slash in the URL *definition*. In the first case, the canonical URL for the224 `projects` endpoint has a trailing slash. In that sense, it is similar to225- a folder on a file system. Accessing it without a trailing slash will cause225+ a folder on a filesystem. Accessing it without a trailing slash will cause226 Flask to redirect to the canonical URL with the trailing slash.227 228 In the second case, however, the URL is defined without a trailing slash,229 rather like the pathname of a file on UNIX-like systems. Accessing the URL664 unmodified linesmodified:docs/upgrading.rst+1 added-1 removed
94 unmodified lines95 as `ValueError` you will need to change this.96 97 Due to a bug in the test client Flask 0.7 did not trigger teardown98 handlers when the test client was used in a with statement. This was99-since fixed but might require some changes in your testsuites if you99+since fixed but might require some changes in your test suites if you100 relied on this behavior.101 102 Version 0.7103 -----------279 unmodified linesmodified:examples/blueprintexample/simple_page/templates/pages/layout.html+1 added-1 removed
2 unmodified lines3456778910119 unmodified lines2 unmodified lines<div class="page"> <h1>This is blueprint example</h1> <p> A simple page blueprint is registered under / and /pages you can access it using this urls: you can access it using this URLs: <ul> <li><a href="{{ url_for('simple_page.show', page='hello') }}">/hello</a> <li><a href="{{ url_for('simple_page.show', page='world') }}">/world</a> </ul>9 unmodified linesmodified:flask/app.py+2 added-2 removed
83 unmodified lines84 .. admonition:: About the First Parameter85 86 The idea of the first parameter is to give Flask an idea of what87 belongs to your application. This name is used to find resources88- on the file system, can be used by extensions to improve debugging88+ on the filesystem, can be used by extensions to improve debugging89 information and a lot more.90 91 So it's important what you provide there. If you are using a single92 module, `__name__` is always the correct value. If you however are195 unmodified lines288 'SESSION_COOKIE_HTTPONLY': True,289 'SESSION_COOKIE_SECURE': False,290 'SESSION_REFRESH_EACH_REQUEST': True,291 'MAX_CONTENT_LENGTH': None,292- 'SEND_FILE_MAX_AGE_DEFAULT': 12 * 60 * 60, # 12 hours292+ 'SEND_FILE_MAX_AGE_DEFAULT': 12 * 60 * 60, # 12 hours293 'TRAP_BAD_REQUEST_ERRORS': False,294 'TRAP_HTTP_EXCEPTIONS': False,295 'EXPLAIN_TEMPLATE_LOADING': False,296 'PREFERRED_URL_SCHEME': 'http',1611 unmodified linesmodified:flask/cli.py+2 added-2 removed
255 unmodified lines256 return click.Group.group(self, *args, **kwargs)257 258 259 class FlaskGroup(AppGroup):260- """Special subclass of the the :class:`AppGroup` group that supports260+ """Special subclass of the :class:`AppGroup` group that supports261 loading more commands from the configured Flask app. Normally a262 developer does not have to interface with this class but there are263- some very advanced usecases for which it makes sense to create an263+ some very advanced use cases for which it makes sense to create an264 instance of this.265 266 For information as of why this is useful see :ref:`custom-scripts`.267 225 unmodified linesmodified:flask/ctx.py+1 added-1 removed
289 unmodified lines290 # on the stack. The rationale is that you want to access that291 # information under debug situations. However if someone forgets to292 # pop that context again we want to make sure that on the next push293 # it's invalidated, otherwise we run at risk that something leaks294- # memory. This is usually only a problem in testsuite since this294+ # memory. This is usually only a problem in test suite since this295 # functionality is not active in production environments.296 top = _request_ctx_stack.top297 if top is not None and top.preserved:298 top.pop(top._preserved_exc)97 unmodified linesmodified:flask/helpers.py+4 added-4 removed
262 unmodified lines263 'application context being pushed. This has to be '264 'executed when application context is available.')265 266 # If request specific information is available we have some extra267- # features that support "relative" urls.267+ # features that support "relative" URLs.268 if reqctx is not None:269 url_adapter = reqctx.url_adapter270 blueprint_name = request.blueprint271 if not reqctx.request._is_old_module:11 unmodified lines283 endpoint = endpoint[1:]284 external = values.pop('_external', False)285 286 # Otherwise go with the url adapter from the appctx and make287- # the urls external by default.287+ # the URLs external by default.288 else:289 url_adapter = appctx.url_adapter290 if url_adapter is None:291 raise RuntimeError('Application was not able to create a URL '236 unmodified lines528 529 rv = current_app.response_class(data, mimetype=mimetype, headers=headers,530 direct_passthrough=True)531 532- # if we know the file modification date, we can store it as the532+ # if we know the file modification date, we can store it as533 # the time of the last modification.534 if mtime is not None:535 rv.last_modified = int(mtime)536 35 unmodified lines572 @app.route('/wiki/<path:filename>')573 def wiki_page(filename):574 filename = safe_join(app.config['WIKI_FOLDER'], filename)575 with open(filename, 'rb') as fd:576- content = fd.read() # Read and process the file content...576+ content = fd.read() # Read and process the file content...577 578 :param directory: the base directory.579 :param filename: the untrusted filename relative to that directory.580 :raises: :class:`~werkzeug.exceptions.NotFound` if the resulting path323 unmodified linesmodified:flask/sessions.py+1 added-1 removed
108 unmodified lines109 session_json_serializer = TaggedJSONSerializer()110 111 112 class SecureCookieSession(CallbackDict, SessionMixin):113- """Baseclass for sessions based on signed cookies."""113+ """Base class for sessions based on signed cookies."""114 115 def __init__(self, initial=None):116 def on_update(self):117 self.modified = True248 unmodified linesmodified:flask/signals.py+2 added-2 removed
2 unmodified lines3 flask.signals4 ~~~~~~~~~~~~~5 6 Implements signals based on blinker if available, otherwise7- falls silently back to a noop7+ falls silently back to a noop.8 9 :copyright: (c) 2014 by Armin Ronacher.10 :license: BSD, see LICENSE for more details.11 """29 unmodified lines41 # not put signals in here. Create your own namespace instead.42 _signals = Namespace()43 44 45-# Core signals. For usage examples grep the sourcecode or consult45+# Core signals. For usage examples grep the source code or consult46 # the API documentation in docs/api.rst as well as docs/signals.rst47 template_rendered = _signals.signal('template-rendered')48 request_started = _signals.signal('request-started')49 request_finished = _signals.signal('request-finished')6 unmodified linesmodified:flask/templating.py+1 added-1 removed
125 unmodified lines126 def render_template_string(source, **context):127 """Renders a template from the given template source string128 with the given context.129 130- :param source: the sourcecode of the template to be130+ :param source: the source code of the template to be131 rendered132 :param context: the variables that should be available in the133 context of the template.134 """4 unmodified linesmodified:flask/views.py+1 added-1 removed
111 unmodified lines112 if key in http_method_funcs:113 methods.add(key.upper())114 # If we have no method at all in there we don't want to115 # add a method list. (This is for instance the case for116- # the baseclass or another subclass of a base method view116+ # the base class or another subclass of a base method view117 # that does not introduce new methods).118 if methods:119 rv.methods = sorted(methods)120 return rv29 unmodified linesmodified:tests/conftest.py-1 removed
31 unmodified lines32 assert leaks == []33 request.addfinalizer(ensure_clean_request_context)34 35 36-36 @pytest.fixture(params=(True, False))37 def limit_loader(request, monkeypatch):38 """Patch pkgutil.get_loader to give loader without get_filename or archive.39 94 unmodified linesmodified:tests/test_appctx.py+2 added-2 removed
39 unmodified lines40 def test_request_context_means_app_context():41 app = flask.Flask(__name__)42 with app.test_request_context():43 assert flask.current_app._get_current_object() == app44- assert flask._app_ctx_stack.top == None44+ assert flask._app_ctx_stack.top is None45 46 def test_app_context_provides_current_app():47 app = flask.Flask(__name__)48 with app.app_context():49 assert flask.current_app._get_current_object() == app50- assert flask._app_ctx_stack.top == None50+ assert flask._app_ctx_stack.top is None51 52 def test_app_tearing_down():53 cleanup_stuff = []54 app = flask.Flask(__name__)57 unmodified linesmodified:tests/test_signals.py-1 removed
17 unmodified lines18 19 import flask20 21 22-22 pytestmark = pytest.mark.skipif(23 blinker is None,24 reason='Signals require the blinker library.'25 )153 unmodified linesmodified:tests/test_templating.py+2 added-2 removed
285 unmodified lines286 return {'whiskey': 'Jameson'}287 @app.route('/')288 def index():289 return flask.render_template(290- ['no_template.xml', # should skip this one291- 'simple_template.html', # should render this290+ ['no_template.xml', # should skip this one291+ 'simple_template.html', # should render this292 'context_template.html'],293 value=23)294 295 rv = app.test_client().get('/')44 unmodified linesmodified:CHANGES+1 added-1 removed
47 unmodified lines48 instruct Flask to explain how it locates templates. This should help49 users debug when the wrong templates are loaded.50 - Enforce blueprint handling in the order they were registered for template51 loading.52-- Ported testsuite to py.test.52+- Ported test suite to py.test.53 - Deprecated ``request.json`` in favour of ``request.get_json()``.54 - Add "pretty" and "compressed" separators definitions in jsonify() method.55 Reduces JSON response size when JSONIFY_PRETTYPRINT_REGULAR=False by removing56 unnecessary white space included by default after separators.483 unmodified lines