Permalink
Browse files

New flask version, using blueprint instead of outdated module

  • Loading branch information...
1 parent 26257d3 commit 669f37c4e620cd35225b16575da869676fd92c53 @Roasbeef Roasbeef committed Aug 30, 2012
Showing with 7,187 additions and 659 deletions.
  1. BIN .DS_Store
  2. +1 −1 app/__init__.py
  3. +2 −2 app/views.py
  4. BIN libs/.DS_Store
  5. +16 −6 libs/flask/__init__.py
  6. +1,065 −253 libs/flask/app.py
  7. +345 −0 libs/flask/blueprints.py
  8. +30 −14 libs/flask/config.py
  9. +244 −15 libs/flask/ctx.py
  10. +79 −0 libs/flask/debughelpers.py
  11. +49 −0 libs/flask/exceptions.py
  12. +29 −0 libs/flask/ext/__init__.py
  13. +119 −0 libs/flask/exthook.py
  14. +22 −6 libs/flask/globals.py
  15. +497 −75 libs/flask/helpers.py
  16. +6 −3 libs/flask/logging.py
  17. +17 −197 libs/flask/module.py
  18. +8 −32 libs/flask/session.py
  19. +205 −0 libs/flask/sessions.py
  20. +4 −2 libs/flask/signals.py
  21. +67 −27 libs/flask/templating.py
  22. +90 −17 libs/flask/testing.py
  23. +221 −0 libs/flask/testsuite/__init__.py
  24. +102 −0 libs/flask/testsuite/appctx.py
  25. +1,211 −0 libs/flask/testsuite/basic.py
  26. +658 −0 libs/flask/testsuite/blueprints.py
  27. +300 −0 libs/flask/testsuite/config.py
  28. +41 −0 libs/flask/testsuite/deprecations.py
  29. +38 −0 libs/flask/testsuite/examples.py
  30. +123 −0 libs/flask/testsuite/ext.py
  31. +466 −0 libs/flask/testsuite/helpers.py
  32. +86 −0 libs/flask/testsuite/regression.py
  33. +103 −0 libs/flask/testsuite/signals.py
  34. +1 −0 libs/flask/testsuite/static/index.html
  35. +46 −0 libs/flask/testsuite/subclassing.py
  36. +1 −0 libs/flask/testsuite/templates/_macro.html
  37. +1 −0 libs/flask/testsuite/templates/context_template.html
  38. +6 −0 libs/flask/testsuite/templates/escaping_template.html
  39. +1 −0 libs/flask/testsuite/templates/mail.txt
  40. +1 −0 libs/flask/testsuite/templates/nested/nested.txt
  41. +1 −0 libs/flask/testsuite/templates/simple_template.html
  42. +1 −0 libs/flask/testsuite/templates/template_filter.html
  43. +203 −0 libs/flask/testsuite/templating.py
  44. +7 −0 libs/flask/testsuite/test_apps/blueprintapp/__init__.py
  45. 0 libs/flask/testsuite/test_apps/blueprintapp/apps/__init__.py
  46. +15 −0 libs/flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.py
  47. +1 −0 libs/flask/testsuite/test_apps/blueprintapp/apps/admin/static/css/test.css
  48. +1 −0 libs/flask/testsuite/test_apps/blueprintapp/apps/admin/static/test.txt
  49. +1 −0 libs/flask/testsuite/test_apps/blueprintapp/apps/admin/templates/admin/index.html
  50. +8 −0 libs/flask/testsuite/test_apps/blueprintapp/apps/frontend/__init__.py
  51. +1 −0 libs/flask/testsuite/test_apps/blueprintapp/apps/frontend/templates/frontend/index.html
  52. +4 −0 libs/flask/testsuite/test_apps/config_module_app.py
  53. +4 −0 libs/flask/testsuite/test_apps/config_package_app/__init__.py
  54. +2 −0 libs/flask/testsuite/test_apps/flask_broken/__init__.py
  55. 0 libs/flask/testsuite/test_apps/flask_broken/b.py
  56. +1 −0 libs/flask/testsuite/test_apps/flask_newext_package/__init__.py
  57. +2 −0 libs/flask/testsuite/test_apps/flask_newext_package/submodule.py
  58. +1 −0 libs/flask/testsuite/test_apps/flask_newext_simple.py
  59. 0 libs/flask/testsuite/test_apps/flaskext/__init__.py
  60. +1 −0 libs/flask/testsuite/test_apps/flaskext/oldext_package/__init__.py
  61. +2 −0 libs/flask/testsuite/test_apps/flaskext/oldext_package/submodule.py
  62. +1 −0 libs/flask/testsuite/test_apps/flaskext/oldext_simple.py
  63. +2 −0 libs/flask/testsuite/test_apps/importerror.py
  64. BIN libs/flask/testsuite/test_apps/lib/python2.5/site-packages/SiteEgg.egg
  65. +3 −0 libs/flask/testsuite/test_apps/lib/python2.5/site-packages/site_app.py
  66. +3 −0 libs/flask/testsuite/test_apps/lib/python2.5/site-packages/site_package/__init__.py
  67. +4 −0 libs/flask/testsuite/test_apps/main_app.py
  68. +7 −0 libs/flask/testsuite/test_apps/moduleapp/__init__.py
  69. 0 libs/flask/testsuite/test_apps/moduleapp/apps/__init__.py
  70. +14 −0 libs/flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py
  71. +1 −0 libs/flask/testsuite/test_apps/moduleapp/apps/admin/static/css/test.css
  72. +1 −0 libs/flask/testsuite/test_apps/moduleapp/apps/admin/static/test.txt
  73. +1 −0 libs/flask/testsuite/test_apps/moduleapp/apps/admin/templates/index.html
  74. +9 −0 libs/flask/testsuite/test_apps/moduleapp/apps/frontend/__init__.py
  75. +1 −0 libs/flask/testsuite/test_apps/moduleapp/apps/frontend/templates/index.html
  76. +3 −0 libs/flask/testsuite/test_apps/path/installed_package/__init__.py
  77. +4 −0 libs/flask/testsuite/test_apps/subdomaintestmodule/__init__.py
  78. +1 −0 libs/flask/testsuite/test_apps/subdomaintestmodule/static/hello.txt
  79. +204 −0 libs/flask/testsuite/testing.py
  80. +152 −0 libs/flask/testsuite/views.py
  81. +150 −0 libs/flask/views.py
  82. +69 −9 libs/flask/wrappers.py
View
BIN .DS_Store
Binary file not shown.
View
@@ -20,5 +20,5 @@ def create_app():
"""
app = Flask(__name__)
app.config.from_object(settings)
- app.register_module(views)
+ app.register_blueprint(views)
return app
View
@@ -7,11 +7,11 @@
from google.appengine.api import mail
-from flask import Module, url_for, render_template, request, redirect
+from flask import Blueprint, url_for, render_template, request, redirect
from models import Todo
from forms import TodoForm, EmailForm
-views = Module(__name__, 'views')
+views = Blueprint(__name__, 'views')
@views.route('/')
View
Binary file not shown.
View
22 libs/flask/__init__.py 100644 → 100755
@@ -6,29 +6,39 @@
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
- :copyright: (c) 2010 by Armin Ronacher.
+ :copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
+__version__ = '0.10-dev'
+
# utilities we import from Werkzeug and Jinja2 that are unused
# in the module but are exported as public interface.
-from werkzeug import abort, redirect
+from werkzeug.exceptions import abort
+from werkzeug.utils import redirect
from jinja2 import Markup, escape
from .app import Flask, Request, Response
from .config import Config
from .helpers import url_for, jsonify, json_available, flash, \
send_file, send_from_directory, get_flashed_messages, \
- get_template_attribute, make_response
-from .globals import current_app, g, request, session, _request_ctx_stack
+ get_template_attribute, make_response, safe_join, \
+ stream_with_context
+from .globals import current_app, g, request, session, _request_ctx_stack, \
+ _app_ctx_stack
+from .ctx import has_request_context, has_app_context, \
+ after_this_request
from .module import Module
+from .blueprints import Blueprint
from .templating import render_template, render_template_string
-from .session import Session
# the signals
from .signals import signals_available, template_rendered, request_started, \
- request_finished, got_request_exception
+ request_finished, got_request_exception, request_tearing_down
# only import json if it's available
if json_available:
from .helpers import json
+
+# backwards compat, goes away in 1.0
+from .sessions import SecureCookieSession as Session
View
1,318 libs/flask/app.py 100644 → 100755

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 669f37c

Please sign in to comment.