Skip to content
Myr

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

19 files+26 added−28 removed

modified:docs/patterns/fabric.rst+2 added-2 removed
30 unmodified lines
31hosts. These hosts can be defined either in the fabfile or on the command32line. In this case we will add them to the fabfile.3334This is a basic first example that has the ability to upload the current35sourcecode to the server and install it into a pre-existing35source code to the server and install it into a pre-existing36virtual environment::3738 from fabric.api import *39
145 unmodified lines
185- 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.190191Working with Fabric is fun and you will notice that it's quite magical to192type ``fab deploy`` and see your application being deployed automatically193to one or more remote servers.
3 unmodified lines
modified:docs/tutorial/index.rst+1 added-1 removed
9 unmodified lines
10features everything you need to get started. We will use Flask and SQLite11as database which comes out of the box with Python, so there is nothing12else you need.1314If you want the full sourcecode in advance or for comparison, check out14If you want the full source code in advance or for comparison, check out15the `example source`_.1617.. _example source:18 https://github.com/mitsuhiko/flask/tree/master/examples/flaskr/
14 unmodified lines
modified:docs/license.rst+1 added-1 removed
24 unmodified lines
2526- "AUTHORS" hereby refers to all the authors listed in the27 :ref:`authors` section.2829- 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.3233- The ":ref:`artwork-license`" applies to the project's Horn-Logo.
15 unmodified lines
modified:docs/quickstart.rst+1 added-1 removed
220 unmodified lines
221222 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.227228 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 URL
664 unmodified lines
modified:docs/upgrading.rst+1 added-1 removed
94 unmodified lines
95as `ValueError` you will need to change this.9697Due to a bug in the test client Flask 0.7 did not trigger teardown98handlers when the test client was used in a with statement. This was99since fixed but might require some changes in your testsuites if you99since fixed but might require some changes in your test suites if you100relied on this behavior.101102Version 0.7103-----------
279 unmodified lines
modified:examples/blueprintexample/simple_page/templates/pages/layout.html+1 added-1 removed
modified:flask/app.py+2 added-2 removed
83 unmodified lines
84 .. admonition:: About the First Parameter8586 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.9091 So it's important what you provide there. If you are using a single92 module, `__name__` is always the correct value. If you however are
195 unmodified lines
288 '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 lines
modified:flask/cli.py+2 added-2 removed
255 unmodified lines
256 return click.Group.group(self, *args, **kwargs)257258259class 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.265266 For information as of why this is useful see :ref:`custom-scripts`.267
225 unmodified lines
modified:flask/ctx.py+1 added-1 removed
289 unmodified lines
290 # 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 lines
modified:flask/helpers.py+4 added-4 removed
262 unmodified lines
263 'application context being pushed. This has to be '264 'executed when application context is available.')265266 # 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 lines
283 endpoint = endpoint[1:]284 external = values.pop('_external', False)285286 # 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 lines
528529 rv = current_app.response_class(data, mimetype=mimetype, headers=headers,530 direct_passthrough=True)531532 # 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 lines
572 @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...577578 :param directory: the base directory.579 :param filename: the untrusted filename relative to that directory.580 :raises: :class:`~werkzeug.exceptions.NotFound` if the resulting path
323 unmodified lines
modified:flask/sessions.py+1 added-1 removed
108 unmodified lines
109session_json_serializer = TaggedJSONSerializer()110111112class SecureCookieSession(CallbackDict, SessionMixin):113 """Baseclass for sessions based on signed cookies."""113 """Base class for sessions based on signed cookies."""114115 def __init__(self, initial=None):116 def on_update(self):117 self.modified = True
248 unmodified lines
modified:flask/signals.py+2 added-2 removed
2 unmodified lines
3 flask.signals4 ~~~~~~~~~~~~~56 Implements signals based on blinker if available, otherwise7 falls silently back to a noop7 falls silently back to a noop.89 :copyright: (c) 2014 by Armin Ronacher.10 :license: BSD, see LICENSE for more details.11"""
29 unmodified lines
41# not put signals in here. Create your own namespace instead.42_signals = Namespace()434445# 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.rst47template_rendered = _signals.signal('template-rendered')48request_started = _signals.signal('request-started')49request_finished = _signals.signal('request-finished')
6 unmodified lines
modified:flask/templating.py+1 added-1 removed
125 unmodified lines
126def render_template_string(source, **context):127 """Renders a template from the given template source string128 with the given context.129130 :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 lines
modified:flask/views.py+1 added-1 removed
111 unmodified lines
112 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 rv
29 unmodified lines
modified:tests/conftest.py-1 removed
31 unmodified lines
32 assert leaks == []33 request.addfinalizer(ensure_clean_request_context)34353636@pytest.fixture(params=(True, False))37def limit_loader(request, monkeypatch):38 """Patch pkgutil.get_loader to give loader without get_filename or archive.39
94 unmodified lines
modified:tests/test_appctx.py+2 added-2 removed
39 unmodified lines
40def 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 None4546def 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 None5152def test_app_tearing_down():53 cleanup_stuff = []54 app = flask.Flask(__name__)
57 unmodified lines
modified:tests/test_signals.py-1 removed
17 unmodified lines
1819import flask20212222pytestmark = pytest.mark.skipif(23 blinker is None,24 reason='Signals require the blinker library.'25)
153 unmodified lines
modified:tests/test_templating.py+2 added-2 removed
285 unmodified lines
286 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)294295 rv = app.test_client().get('/')
44 unmodified lines
modified:CHANGES+1 added-1 removed
47 unmodified lines
48 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