From 8017febac4d8cfec57378a6d5514ab19957f8cdc Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 30 May 2011 15:06:32 +0200 Subject: [PATCH 1/5] Don't fail for unicode filenames with send_file(add_etags=True) --- flask/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flask/helpers.py b/flask/helpers.py index a25dcadd..806ff0ee 100644 --- a/flask/helpers.py +++ b/flask/helpers.py @@ -379,7 +379,10 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False, rv.set_etag('flask-%s-%s-%s' % ( os.path.getmtime(filename), os.path.getsize(filename), - adler32(filename) & 0xffffffff + adler32( + filename.encode('utf8') if isinstance(filename, unicode) + else filename + ) & 0xffffffff )) if conditional: rv = rv.make_conditional(request) From e6b9f509ba3c47f748d5c6da5f6de5500248dbfd Mon Sep 17 00:00:00 2001 From: Peter Manser Date: Mon, 20 Jun 2011 23:51:30 +0200 Subject: [PATCH 2/5] Improving documentation for loading jQuery. Now using Google CDN with fallback to local jQuery. --- docs/patterns/jquery.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/patterns/jquery.rst b/docs/patterns/jquery.rst index d4fe6d4e..f3c46e39 100644 --- a/docs/patterns/jquery.rst +++ b/docs/patterns/jquery.rst @@ -23,7 +23,7 @@ Loading jQuery In order to use jQuery, you have to download it first and place it in the static folder of your application and then ensure it's loaded. Ideally you have a layout template that is used for all pages where you just have -to add a script statement to your `head` to load jQuery: +to add a script statement to the bottom of your `` to load jQuery: .. sourcecode:: html @@ -35,15 +35,15 @@ Another method is using Google's `AJAX Libraries API .. sourcecode:: html - + + -In this case you don't have to put jQuery into your static folder, it will -instead be loaded from Google directly. This has the advantage that your +In this case you have to put jQuery into your static folder as a fallback, but it will +first try to load it directly from Google. This has the advantage that your website will probably load faster for users if they went to at least one other website before using the same jQuery version from Google because it -will already be in the browser cache. Downside is that if you don't have -network connectivity during development jQuery will not load. +will already be in the browser cache. Where is My Site? ----------------- From c40937e7bf1df492c99705733f6550f3f09baf91 Mon Sep 17 00:00:00 2001 From: wilsaj Date: Tue, 21 Jun 2011 10:05:26 -0500 Subject: [PATCH 3/5] Bug fix in the documentation for Deploying with Fabric: as of Fabric 1.0, in the local() function capture=False by default, so it must be explicitly set to capture=True so it returns a python string (http://docs.fabfile.org/en/1.0.1/api/core/operations.html#fabric.operations.local) --- docs/patterns/fabric.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/patterns/fabric.rst b/docs/patterns/fabric.rst index dbd4f913..b02ad277 100644 --- a/docs/patterns/fabric.rst +++ b/docs/patterns/fabric.rst @@ -48,7 +48,7 @@ virtual environment:: def deploy(): # figure out the release name and version - dist = local('python setup.py --fullname').strip() + dist = local('python setup.py --fullname', capture=True).strip() # upload the source tarball to the temporary folder on the server put('dist/%s.tar.gz' % dist, '/tmp/yourapplication.tar.gz') # create a place where we can unzip the tarball, then enter From 239d9ccf5773c84a4f3faf7e415bb298892c2063 Mon Sep 17 00:00:00 2001 From: Ron DuPlain Date: Thu, 23 Jun 2011 08:42:27 -0400 Subject: [PATCH 4/5] Remove extreview .rst in favor of website listing. --- extreview/approved.rst | 168 ----------------------------------------- extreview/listed.rst | 64 ---------------- extreview/unlisted.rst | 55 -------------- 3 files changed, 287 deletions(-) delete mode 100644 extreview/approved.rst delete mode 100644 extreview/listed.rst delete mode 100644 extreview/unlisted.rst diff --git a/extreview/approved.rst b/extreview/approved.rst deleted file mode 100644 index 82bbf9f7..00000000 --- a/extreview/approved.rst +++ /dev/null @@ -1,168 +0,0 @@ -Approved Extensions -=================== - -This document contains a list of all extensions that were approved and the -date of approval as well as notes. This should make it possible to better -track the extension approval process. - - -Flask-Babel ------------ - -:First Approval: 2010-07-23 -:Last Review: 2010-07-23 -:Approved Version: 0.6 -:Approved License: BSD - -Notes: Developed by the Flask development head - -How to improve: add a better long description to the next release - - -Flask-SQLAlchemy ----------------- - -:First Approval: 2010-07-25 -:Last Review: 2010-07-25 -:Approved Version: 0.9.1 -:Approved License: BSD - -Notes: Developed by the Flask development head - -How to improve: add a better long description to the next release - - -Flask-Creole ------------- - -:First Approval: 2010-07-25 -:Last Review: 2010-07-25 -:Approved Version: 0.4.4 -:Approved License: BSD - -Notes: Flask-Markdown and this should share API, consider that when -approving Flask-Markdown - - -Flask-Genshi ------------- - -:First Approval: 2010-07-26 -:Last Review: 2010-07-26 -:Approved Version: 0.3.1 -:Approved License: BSD - -Notes: This is the first template engine extension. When others come -around it would be a good idea to decide on a common interface. - - -Flask-Script ------------- - -:First Approval: 2010-07-26 -:Last Review: 2010-07-26 -:Approved Version: 0.3 -:Approved License: BSD - -Notes: Flask-Actions has some overlap. Consider that when approving -Flask-Actions or similar packages. - - -Flask-CouchDB -------------- - -:First Approval: 2010-07-26 -:Last Review: 2010-07-26 -:Approved Version: 0.2.1 -:Approved License: MIT - -There is also Flask-CouchDBKit. Both are fine because they are doing -different things, but the latter is not yet approved. - - -Flask-Testing -------------- - -:First Approval: 2010-07-27 -:Last Review: 2010-07-27 -:Approved Version: 0.2.3 -:Approved License: BSD - -All fine. - - -Flask-WTF ---------- - -:First Approval: 2010-07-27 -:Last Review: 2010-07-27 -:Approved Version: 0.2.3 -:Approved License: BSD - -All fine. - - -Flask-Themes ------------- - -:First Approval: 2010-07-27 -:Last Review: 2010-07-27 -:Approved Version: 0.1.2 -:Approved License: MIT - -All fine. - - -Flask-Uploads -------------- - -:First Approval: 2010-07-27 -:Last Review: 2010-07-27 -:Approved Version: 0.1.2 -:Approved License: MIT - -All fine. - - -Flask-Mail ----------- - -:First Approval: 2010-07-29 -:Last Review: 2010-07-29 -:Approved Version: 0.3.4 -:Approved License: BSD - -All fine. - - -Flask-XML-RPC -------------- - -:First Approval: 2010-07-30 -:Last Review: 2010-07-30 -:Approved Version: 0.1.2 -:Approved License: MIT - -All fine. - - -Frozen-Flask ------------- - -:First Approval: 2011-06-05 -:Last Review: 2011-06-05 -:Approved Version: 0.4 -:Approved License: BSD - -All fine. Posted recommendations for minor items/enhancements to mailing list. - - -Flask-Login ------------ - -:First Approval: 2011-06-07 -:Last Review: 2011-06-07 -:Approved Version: 0.1 -:Approved License: MIT - -All fine. diff --git a/extreview/listed.rst b/extreview/listed.rst deleted file mode 100644 index 474213cb..00000000 --- a/extreview/listed.rst +++ /dev/null @@ -1,64 +0,0 @@ -Listed Extensions -================= - -This list contains extensions that passed listing. This means the -extension is on the list of extensions on the website. It does not -contain extensions that are approved. - - -Flask-CouchDBKit ----------------- - -:Last-Review: 2010-07-25 -:Reviewed Version: 0.2 - -Would be fine for approval, but the test suite is not part of the sdist -package (missing entry in MANIFEST.in) and the test suite does not respond -to either "make test" or "python setup.py test". - - -flask-csrf ----------- - -:Last-Review: 2010-07-25 -:Reviewed Version: 0.2 - -Will not be approved because this is functionality that should be handled -in the form handling systems which is for Flask-WTF already the case. -Also, this implementation only supports one open tab with forms. - -Name is not following Flask extension naming rules. - -Considered for unlisting. - - -flask-lesscss -------------- - -:Last-Review: 2010-07-25 -:Reviewed Version: 0.9.1 - -Broken package description, nonconforming package name, does not follow -standard API rules (init_lesscss instead of lesscss). - -Considered for unlisting, improved version should release as -"Flask-LessCSS" with a conforming API and fixed packages indices, as well -as a testsuite. - - -Flask-OAuth ------------ - -:Last-Review: 2010-07-25 -:Reviewed Version: 0.9 - -Short long description, missing tests. - - -Flask-OpenID ------------- - -:Last-Review: 2010-07-25 -:Reviewed Version: 1.0.1 - -Short long description, missing tests. diff --git a/extreview/unlisted.rst b/extreview/unlisted.rst deleted file mode 100644 index 6ee8b441..00000000 --- a/extreview/unlisted.rst +++ /dev/null @@ -1,55 +0,0 @@ -Unlisted Extensions -=================== - -This is a list of extensions that is currently rejected from listing and -with that also not approved. If an extension ends up here it should -improved to be listed. - - -Flask-Actions -------------- - -:Last Review: 2010-07-25 -:Reviewed Version: 0.2 - -Rejected because of missing description in PyPI, formatting issues with -the documentation (missing headlines, scrollbars etc.) and a general clash -of functionality with the Flask-Script package. Latter should not be a -problem, but the documentation should improve. For listing, the extension -developer should probably discuss the extension on the mailinglist with -others. - -Futhermore it also has an egg registered with an invalid filename. - - -Flask-Jinja2Extender --------------------- - -:Last Review: 2010-07-25 -:Reviewed Version: 0.1 - -Usecase not obvious, hacky implementation, does not solve a problem that -could not be solved with Flask itself. I suppose it is to aid other -extensions, but that should be discussed on the mailinglist. - - -Flask-Markdown --------------- - -:Last Review: 2010-07-25 -:Reviewed Version: 0.2 - -Would be great for enlisting but it should follow the API of Flask-Creole. -Besides that, the docstrings are not valid rst (run through rst2html to -see the issue) and it is missing tests. Otherwise fine :) - - -flask-urls ----------- - -:Last Review: 2010-07-25 -:Reviewed Version: 0.9.2 - -Broken PyPI index and non-conforming extension name. Due to the small -featureset this was also delisted from the list. It was there previously -before the approval process was introduced. From 0e98a080976f39e20aa6f18e8a335aa23d9334f7 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 25 Jun 2011 12:26:07 +0200 Subject: [PATCH 5/5] Provide ways to override the url rule --- flask/app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flask/app.py b/flask/app.py index 1e068e41..c7b287a6 100644 --- a/flask/app.py +++ b/flask/app.py @@ -200,6 +200,12 @@ class Flask(_PackageBoundObject): 'MAX_CONTENT_LENGTH': None }) + #: The rule object to use for URL rules created. This is used by + #: :meth:`add_url_rule`. Defaults to :class:`werkzeug.routing.Rule`. + #: + #: .. versionadded:: 0.7 + url_rule_class = Rule + #: the test client that is used with when `test_client` is used. #: #: .. versionadded:: 0.7 @@ -573,7 +579,7 @@ class Flask(_PackageBoundObject): if 'OPTIONS' not in methods: methods = tuple(methods) + ('OPTIONS',) provide_automatic_options = True - rule = Rule(rule, methods=methods, **options) + rule = self.url_rule_class(rule, methods=methods, **options) rule.provide_automatic_options = provide_automatic_options self.url_map.add(rule) if view_func is not None: