Skip to content
Myr

Merge branch 'master' into module-support

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Conflicts: flask.py

authored by Armin Ronacher · committed by Armin Ronacher · parents 7e1db59, 75461c1 · Browse files · 3 files+6 added−1 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+6 added−1 removed

  • tests:+2 added−0 removed
  • other:+4 added−1 removed

3 files+6 added−1 removed

modified:tests/flask_tests.py+2 added
225 unmodified lines
226 def hello():227 pass228 with app.test_request_context():229 assert flask.url_for('hello', name='test x') == '/hello/test%20x'230 assert flask.url_for('hello', name='test x', _external=True) \231 == 'http://localhost/hello/test%20x'232233 def test_custom_converters(self):234 from werkzeug.routing import BaseConverter235 class ListConverter(BaseConverter):
225 unmodified lines
modified:CHANGES+1 added
12 unmodified lines
13- added :func:`~flask.get_template_attribute` helper function.14- :meth:`~flask.Flask.add_url_rule` can now also register a15 view function.16- server listens on 127.0.0.1 by default now to fix issues with chrome.17- added external URL support.1819Version 0.120-----------21
1 unmodified line
modified:flask.py+3 added-1 removed
177 unmodified lines
178 For more information, head over to the :ref:`Quickstart <url-building>`.179180 :param endpoint: the endpoint of the URL (name of the function)181 :param values: the variable arguments of the URL rule182 :param _external: if set to `True`, an absolute URL is generated.183 """184 ctx = _request_ctx_stack.top185 if '.' not in endpoint:186 mod = ctx.request.module187 if mod is not None:188 endpoint = mod + '.' + endpoint189 elif endpoint.startswith('.'):190 endpoint = endpoint[1:]191 external = values.pop('_external', False)190 return ctx.url_adapter.build(endpoint, values)192 return ctx.url_adapter.build(endpoint, values, force_external=external)193194195def get_template_attribute(template_name, attribute):196 """Loads a macro (or variable) a template exports. This can be used to
847 unmodified lines