Skip to content

Commit

Permalink
New flask version, using blueprint instead of outdated module
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Aug 30, 2012
1 parent 26257d3 commit 669f37c
Show file tree
Hide file tree
Showing 82 changed files with 7,187 additions and 659 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion app/__init__.py
Expand Up @@ -20,5 +20,5 @@ def create_app():
""" """
app = Flask(__name__) app = Flask(__name__)
app.config.from_object(settings) app.config.from_object(settings)
app.register_module(views) app.register_blueprint(views)
return app return app
4 changes: 2 additions & 2 deletions app/views.py
Expand Up @@ -7,11 +7,11 @@


from google.appengine.api import mail 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 models import Todo
from forms import TodoForm, EmailForm from forms import TodoForm, EmailForm


views = Module(__name__, 'views') views = Blueprint(__name__, 'views')




@views.route('/') @views.route('/')
Expand Down
Binary file added libs/.DS_Store
Binary file not shown.
22 changes: 16 additions & 6 deletions libs/flask/__init__.py 100644 → 100755
Expand Up @@ -6,29 +6,39 @@
A microframework based on Werkzeug. It's extensively documented A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns. and follows best practice patterns.
:copyright: (c) 2010 by Armin Ronacher. :copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details. :license: BSD, see LICENSE for more details.
""" """


__version__ = '0.10-dev'

# utilities we import from Werkzeug and Jinja2 that are unused # utilities we import from Werkzeug and Jinja2 that are unused
# in the module but are exported as public interface. # 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 jinja2 import Markup, escape


from .app import Flask, Request, Response from .app import Flask, Request, Response
from .config import Config from .config import Config
from .helpers import url_for, jsonify, json_available, flash, \ from .helpers import url_for, jsonify, json_available, flash, \
send_file, send_from_directory, get_flashed_messages, \ send_file, send_from_directory, get_flashed_messages, \
get_template_attribute, make_response get_template_attribute, make_response, safe_join, \
from .globals import current_app, g, request, session, _request_ctx_stack 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 .module import Module
from .blueprints import Blueprint
from .templating import render_template, render_template_string from .templating import render_template, render_template_string
from .session import Session


# the signals # the signals
from .signals import signals_available, template_rendered, request_started, \ 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 # only import json if it's available
if json_available: if json_available:
from .helpers import json from .helpers import json

# backwards compat, goes away in 1.0
from .sessions import SecureCookieSession as Session
1,318 changes: 1,065 additions & 253 deletions libs/flask/app.py 100644 → 100755

Large diffs are not rendered by default.

0 comments on commit 669f37c

Please sign in to comment.