Commit graph

133 commits

Author SHA1 Message Date
Markus Unterwaditzer
b49074eb6b Add documentation about url_for's default scheme
Fix #1129
2014-08-11 11:56:55 +02:00
Carlos E. Garcia
52fa195d45 few mispelling errors 2014-04-23 10:46:38 -04:00
Armin Ronacher
d4b3d16c14 Better support for namespace packages. 2014-04-11 19:59:54 +02:00
Armin Ronacher
a293b99b21 Fixed the last changeset. 2014-04-11 13:31:57 +02:00
Armin Ronacher
9554844e2a Added workaround for Python 3.3's frozen loader 2014-04-11 13:31:17 +02:00
Kenneth Reitz
9c434ebc67 Merge pull request #885 from jmhobbs/master
Update url_for documentation for Flask.url_build_error_handlers
2014-03-21 17:01:55 -04:00
Armin Ronacher
9298d89aed Merge branch '0.10-maintenance' 2014-02-09 13:14:26 +00:00
Armin Ronacher
76e2f9cd03 Fixed send_from_directory not rebasing to the root path. This fixes #921 2014-02-09 13:01:54 +00:00
Armin Ronacher
23d9b33e92 Merge branch '0.10-maintenance' 2014-02-08 22:30:00 +00:00
Armin Ronacher
e2264d0607 Merge pull request #936 from zheller/fix-typo
Fix typo in helpers.py
2014-02-08 17:46:32 +00:00
Armin Ronacher
2506c0b9a9 Fixed sending etags for file streams with a name. This fixes #930. 2014-02-08 17:45:27 +00:00
Daniel Neuhäuser
52098e1e4f Happy New Year 2014 2014-01-02 19:21:07 +01:00
Zachary Wright Heller
5addabfbdd Fix typo in helpers.py 2013-12-24 20:12:34 -08:00
John Hobbs
e31a2a80ec Update url_for documentation
Previous documentation referenced a non-existent property on the Flask
object called "build_error_handler".

This should actually reference Flask.url_build_error_handlers.
2013-10-11 17:03:54 -05:00
Daniel Neuhäuser
94f4360137 Explain is_package AttributeError in find_package
When a PEP 302 import hook is used that doesn't implement .is_package()
an AttributeError is raised. This looks like a bug in Flask. This change
fixes that problem in the sense that it explains, that the
AttributeError is intentional.
2013-08-13 15:53:58 +02:00
Armin Ronacher
0190b770a1 Removed a bunch of code from _compat 2013-06-02 17:23:53 +01:00
Armin Ronacher
9ae8487330 Fixed a broekn testcase 2013-05-30 16:16:39 +01:00
Armin Ronacher
47572c5b40 Set the content length automatically before calling wrap_file 2013-05-30 14:24:29 +01:00
Daniel Neuhäuser
404265110a Always return a list from get_flashed_messages 2013-05-26 21:46:22 +02:00
Thomas Waldmann
13cc69911c fix typos 2013-05-25 22:01:14 +02:00
Thomas Waldmann
96b8ffbb29 always import from ._compat 2013-05-25 20:24:14 +02:00
Thomas Waldmann
8bb972e5ae fix minitwit/flaskr test errors, improve docs about file open mode
app.open_resource needs to get called with the correct mode param (python3
will read bytes [not str] if the wrong mode is used), add mode param docs.

rv.data is bytes, fix the data type we compare it with to be also bytes
2013-05-25 19:13:48 +02:00
Daniel Neuhäuser
a0801719f8 Remove six dependency 2013-05-22 21:40:30 +02:00
Thomas Waldmann
e1d356fb71 ported some more stuff to py 3.3
removed init_jinja_globals hack from app.py after consulting mitsuhiko
(didn't work on py 3.3 "as is")

removed with_statement future imports, not needed any more

needs more work on 2.7 as well as on 3.3
2013-05-22 01:33:04 +02:00
Daniel Neuhäuser
8494574fdf Merge branch 'six' of github.com:ThomasWaldmann/flask into ThomasWaldmann-six
Conflicts:
	flask/testsuite/__init__.py
2013-05-18 18:54:45 +02:00
Thomas Waldmann
dcd052366b python-modernize automated changes: fix_next 2013-05-18 18:03:37 +02:00
Thomas Waldmann
6caaa8a527 automated change using python-modernize: use 'as' in except 2013-05-18 16:24:40 +02:00
Paulo Poiati
b2aae044ca Flash messages signals
If we send a signal when a template is rendered why not when a message
is flashed? One real world use case is in tests, this signal should make
flash messages expectation easier to implement.
2013-02-28 01:19:52 -03:00
Kenneth Reitz
777c0c56b5 Merge pull request #630 from untitaker/doc_fix_appctx
Fix #623
2013-01-24 20:13:30 -08:00
Max Countryman
b5069d07a2 adding _scheme parameter to url_for
In order to better facilitate generation of URLs that make use of an HTTPS URL
scheme this patch adds a parameter with this specific purpose in mind. To
achieve this we explicitly pass in a param, `_scheme='https'`, and then set the
`url_scheme` attribute of our `MapAdapter` instance appropriately.

Importantly, `_external=True` must be set in order for this to work properly.
As such, failure to do so results in a `ValueError` being raised.
2013-01-21 16:18:46 -08:00
Markus Unterwaditzer
2b30900e2c Fix #623 2013-01-11 16:52:38 +01:00
Mitchell Peabody
275f830c83 There was a duplicated call to url_adapter.build(...)
try:
        rv = url_adapter.build(endpoint, values, method=method,
                               force_external=external)
    except BuildError, error:
        # We need to inject the values again so that the app callback can
        # deal with that sort of stuff.
        values['_external'] = external
        values['_anchor'] = anchor
        values['_method'] = method
        return appctx.app.handle_url_build_error(error, endpoint, values)

   rv = url_adapter.build(endpoint, values, method=method,
                          force_external=external)

If no exception was raised for url_adapter.build(...) then the same method call
would be made after the try...except block. This is unnecessary.
2012-10-17 11:56:39 -04:00
Armin Ronacher
b146d8277a Added wrapper module around simplejson/json for much simplified customization. 2012-10-07 23:31:48 +02:00
Armin Ronacher
301e244df3 Consistent use of encoding naming 2012-10-07 22:59:52 +02:00
Armin Ronacher
3afcbf160e Extra safety for safe_join. Does not look exploitable but better safe than sorry. Fixes #501 2012-10-07 22:58:41 +02:00
Armin Ronacher
c4f2075f4c tojson no longer escapes script blocks in HTML5 parsers. Fixed #605 2012-10-07 15:33:25 +02:00
Armin Ronacher
3bec75d230 Set the content-length header for sendfile. Fixes #447 2012-10-07 15:24:03 +02:00
Armin Ronacher
c3d38a21c6 Removed json_available hack 2012-08-11 03:11:40 +01:00
Priit Laes
e3b3e05052 Docs: Fix docstring formatting 2012-08-01 11:29:40 +03:00
Priit Laes
ed1619adad Docs: Mention SERVER_NAME in the url_for() docstring 2012-08-01 11:27:28 +03:00
Armin Ronacher
d5218997d9 Added flask.stream_with_context 2012-06-27 15:06:39 +01:00
Armin Ronacher
2e816f554a Merge branch 'master' of github.com:mitsuhiko/flask 2012-06-27 12:25:21 +01:00
Armin Ronacher
8071f11328 Fixed an issue with the new path finding logic 2012-06-26 17:18:59 +02:00
Armin Ronacher
b04827283e Removed padded JSON (JSONP) again.
The implementation was not clean and generally the needs for padded json
are disappearing now that all browsers support cross site communication
with the regular xmlhttprequest.
2012-06-17 14:17:22 +01:00
Massimo Santini
4b21e2d38c I think it should check that cache_timeout is not None to allow for a (I hope legale) value of 0 for such parameter. 2012-06-13 16:43:34 +03:00
Marc Abramowitz
447afc3525 Fix failing test: "AssertionError: 'application/javascript' != 'application/json'" in flask/testsuite/helpers.py", line 88 2012-05-27 18:24:27 -07:00
Armin Ronacher
2053d04db0 Improved interface for the URL build error handler 2012-05-08 11:56:11 +01:00
Ron DuPlain
26da6a5365 Use default send_file max-age consistently.
Prior to this commit, the send_file max-age hook and config were only
used for the static file handler. Now they are used when calling
helpers.send_file directly.
2012-04-24 01:48:05 -04:00
Ron DuPlain
148c50abf9 Document url_for BuildError hook. 2012-04-23 21:20:47 -04:00
Ron DuPlain
bb31188ec3 Add a BuildError hook to url_for, #456. 2012-04-22 12:30:15 -04:00