Merge pull request #1225 from s3rvac/typo-and-cosmetic-fixes
Typo and cosmetic fixes
This commit is contained in:
commit
84efebd6be
19 changed files with 26 additions and 28 deletions
2
CHANGES
2
CHANGES
|
|
@ -49,7 +49,7 @@ Version 1.0
|
|||
users debug when the wrong templates are loaded.
|
||||
- Enforce blueprint handling in the order they were registered for template
|
||||
loading.
|
||||
- Ported testsuite to py.test.
|
||||
- Ported test suite to py.test.
|
||||
- Deprecated ``request.json`` in favour of ``request.get_json()``.
|
||||
- Add "pretty" and "compressed" separators definitions in jsonify() method.
|
||||
Reduces JSON response size when JSONIFY_PRETTYPRINT_REGULAR=False by removing
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ documentation.
|
|||
- "AUTHORS" hereby refers to all the authors listed in the
|
||||
:ref:`authors` section.
|
||||
|
||||
- The ":ref:`flask-license`" applies to all the sourcecode shipped as
|
||||
- The ":ref:`flask-license`" applies to all the source code shipped as
|
||||
part of Flask (Flask itself as well as the examples and the unittests)
|
||||
as well as documentation.
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ hosts. These hosts can be defined either in the fabfile or on the command
|
|||
line. In this case we will add them to the fabfile.
|
||||
|
||||
This is a basic first example that has the ability to upload the current
|
||||
sourcecode to the server and install it into a pre-existing
|
||||
source code to the server and install it into a pre-existing
|
||||
virtual environment::
|
||||
|
||||
from fabric.api import *
|
||||
|
|
@ -186,7 +186,7 @@ deployment actually fun:
|
|||
out the latest version on the server and then install. That way you
|
||||
can also easily go back to older versions.
|
||||
- hook in testing functionality so that you can deploy to an external
|
||||
server and run the testsuite.
|
||||
server and run the test suite.
|
||||
|
||||
Working with Fabric is fun and you will notice that it's quite magical to
|
||||
type ``fab deploy`` and see your application being deployed automatically
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ The following converters exist:
|
|||
Though they look rather similar, they differ in their use of the trailing
|
||||
slash in the URL *definition*. In the first case, the canonical URL for the
|
||||
`projects` endpoint has a trailing slash. In that sense, it is similar to
|
||||
a folder on a file system. Accessing it without a trailing slash will cause
|
||||
a folder on a filesystem. Accessing it without a trailing slash will cause
|
||||
Flask to redirect to the canonical URL with the trailing slash.
|
||||
|
||||
In the second case, however, the URL is defined without a trailing slash,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ features everything you need to get started. We will use Flask and SQLite
|
|||
as database which comes out of the box with Python, so there is nothing
|
||||
else you need.
|
||||
|
||||
If you want the full sourcecode in advance or for comparison, check out
|
||||
If you want the full source code in advance or for comparison, check out
|
||||
the `example source`_.
|
||||
|
||||
.. _example source:
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ as `ValueError` you will need to change this.
|
|||
|
||||
Due to a bug in the test client Flask 0.7 did not trigger teardown
|
||||
handlers when the test client was used in a with statement. This was
|
||||
since fixed but might require some changes in your testsuites if you
|
||||
since fixed but might require some changes in your test suites if you
|
||||
relied on this behavior.
|
||||
|
||||
Version 0.7
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<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>
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class Flask(_PackageBoundObject):
|
|||
|
||||
The idea of the first parameter is to give Flask an idea of what
|
||||
belongs to your application. This name is used to find resources
|
||||
on the file system, can be used by extensions to improve debugging
|
||||
on the filesystem, can be used by extensions to improve debugging
|
||||
information and a lot more.
|
||||
|
||||
So it's important what you provide there. If you are using a single
|
||||
|
|
@ -289,7 +289,7 @@ class Flask(_PackageBoundObject):
|
|||
'SESSION_COOKIE_SECURE': False,
|
||||
'SESSION_REFRESH_EACH_REQUEST': True,
|
||||
'MAX_CONTENT_LENGTH': None,
|
||||
'SEND_FILE_MAX_AGE_DEFAULT': 12 * 60 * 60, # 12 hours
|
||||
'SEND_FILE_MAX_AGE_DEFAULT': 12 * 60 * 60, # 12 hours
|
||||
'TRAP_BAD_REQUEST_ERRORS': False,
|
||||
'TRAP_HTTP_EXCEPTIONS': False,
|
||||
'EXPLAIN_TEMPLATE_LOADING': False,
|
||||
|
|
|
|||
|
|
@ -257,10 +257,10 @@ class AppGroup(click.Group):
|
|||
|
||||
|
||||
class FlaskGroup(AppGroup):
|
||||
"""Special subclass of the the :class:`AppGroup` group that supports
|
||||
"""Special subclass of the :class:`AppGroup` group that supports
|
||||
loading more commands from the configured Flask app. Normally a
|
||||
developer does not have to interface with this class but there are
|
||||
some very advanced usecases for which it makes sense to create an
|
||||
some very advanced use cases for which it makes sense to create an
|
||||
instance of this.
|
||||
|
||||
For information as of why this is useful see :ref:`custom-scripts`.
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ class RequestContext(object):
|
|||
# information under debug situations. However if someone forgets to
|
||||
# pop that context again we want to make sure that on the next push
|
||||
# it's invalidated, otherwise we run at risk that something leaks
|
||||
# memory. This is usually only a problem in testsuite since this
|
||||
# memory. This is usually only a problem in test suite since this
|
||||
# functionality is not active in production environments.
|
||||
top = _request_ctx_stack.top
|
||||
if top is not None and top.preserved:
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ def url_for(endpoint, **values):
|
|||
'executed when application context is available.')
|
||||
|
||||
# If request specific information is available we have some extra
|
||||
# features that support "relative" urls.
|
||||
# features that support "relative" URLs.
|
||||
if reqctx is not None:
|
||||
url_adapter = reqctx.url_adapter
|
||||
blueprint_name = request.blueprint
|
||||
|
|
@ -284,7 +284,7 @@ def url_for(endpoint, **values):
|
|||
external = values.pop('_external', False)
|
||||
|
||||
# Otherwise go with the url adapter from the appctx and make
|
||||
# the urls external by default.
|
||||
# the URLs external by default.
|
||||
else:
|
||||
url_adapter = appctx.url_adapter
|
||||
if url_adapter is None:
|
||||
|
|
@ -529,7 +529,7 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
|
|||
rv = current_app.response_class(data, mimetype=mimetype, headers=headers,
|
||||
direct_passthrough=True)
|
||||
|
||||
# if we know the file modification date, we can store it as the
|
||||
# if we know the file modification date, we can store it as
|
||||
# the time of the last modification.
|
||||
if mtime is not None:
|
||||
rv.last_modified = int(mtime)
|
||||
|
|
@ -573,7 +573,7 @@ def safe_join(directory, filename):
|
|||
def wiki_page(filename):
|
||||
filename = safe_join(app.config['WIKI_FOLDER'], filename)
|
||||
with open(filename, 'rb') as fd:
|
||||
content = fd.read() # Read and process the file content...
|
||||
content = fd.read() # Read and process the file content...
|
||||
|
||||
:param directory: the base directory.
|
||||
:param filename: the untrusted filename relative to that directory.
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ session_json_serializer = TaggedJSONSerializer()
|
|||
|
||||
|
||||
class SecureCookieSession(CallbackDict, SessionMixin):
|
||||
"""Baseclass for sessions based on signed cookies."""
|
||||
"""Base class for sessions based on signed cookies."""
|
||||
|
||||
def __init__(self, initial=None):
|
||||
def on_update(self):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
~~~~~~~~~~~~~
|
||||
|
||||
Implements signals based on blinker if available, otherwise
|
||||
falls silently back to a noop
|
||||
falls silently back to a noop.
|
||||
|
||||
:copyright: (c) 2014 by Armin Ronacher.
|
||||
:license: BSD, see LICENSE for more details.
|
||||
|
|
@ -42,7 +42,7 @@ except ImportError:
|
|||
_signals = Namespace()
|
||||
|
||||
|
||||
# Core signals. For usage examples grep the sourcecode or consult
|
||||
# Core signals. For usage examples grep the source code or consult
|
||||
# the API documentation in docs/api.rst as well as docs/signals.rst
|
||||
template_rendered = _signals.signal('template-rendered')
|
||||
request_started = _signals.signal('request-started')
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ def render_template_string(source, **context):
|
|||
"""Renders a template from the given template source string
|
||||
with the given context.
|
||||
|
||||
:param source: the sourcecode of the template to be
|
||||
:param source: the source code of the template to be
|
||||
rendered
|
||||
:param context: the variables that should be available in the
|
||||
context of the template.
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class MethodViewType(type):
|
|||
methods.add(key.upper())
|
||||
# If we have no method at all in there we don't want to
|
||||
# add a method list. (This is for instance the case for
|
||||
# the baseclass or another subclass of a base method view
|
||||
# the base class or another subclass of a base method view
|
||||
# that does not introduce new methods).
|
||||
if methods:
|
||||
rv.methods = sorted(methods)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ def leak_detector(request):
|
|||
request.addfinalizer(ensure_clean_request_context)
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(params=(True, False))
|
||||
def limit_loader(request, monkeypatch):
|
||||
"""Patch pkgutil.get_loader to give loader without get_filename or archive.
|
||||
|
|
|
|||
|
|
@ -41,13 +41,13 @@ def test_request_context_means_app_context():
|
|||
app = flask.Flask(__name__)
|
||||
with app.test_request_context():
|
||||
assert flask.current_app._get_current_object() == app
|
||||
assert flask._app_ctx_stack.top == None
|
||||
assert flask._app_ctx_stack.top is None
|
||||
|
||||
def test_app_context_provides_current_app():
|
||||
app = flask.Flask(__name__)
|
||||
with app.app_context():
|
||||
assert flask.current_app._get_current_object() == app
|
||||
assert flask._app_ctx_stack.top == None
|
||||
assert flask._app_ctx_stack.top is None
|
||||
|
||||
def test_app_tearing_down():
|
||||
cleanup_stuff = []
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ except ImportError:
|
|||
import flask
|
||||
|
||||
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
blinker is None,
|
||||
reason='Signals require the blinker library.'
|
||||
|
|
|
|||
|
|
@ -287,8 +287,8 @@ def test_iterable_loader():
|
|||
@app.route('/')
|
||||
def index():
|
||||
return flask.render_template(
|
||||
['no_template.xml', # should skip this one
|
||||
'simple_template.html', # should render this
|
||||
['no_template.xml', # should skip this one
|
||||
'simple_template.html', # should render this
|
||||
'context_template.html'],
|
||||
value=23)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue