2015-08-02 20:59:11 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
flask
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
A microframework based on Werkzeug. It's extensively documented
|
|
|
|
and follows best practice patterns.
|
|
|
|
|
2016-11-09 19:24:33 +01:00
|
|
|
:copyright: (c) 2015 by Armin Ronacher.
|
2015-08-02 20:59:11 +02:00
|
|
|
:license: BSD, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
|
2016-11-09 19:24:33 +01:00
|
|
|
__version__ = '0.11'
|
2015-08-02 20:59:11 +02:00
|
|
|
|
|
|
|
# utilities we import from Werkzeug and Jinja2 that are unused
|
|
|
|
# in the module but are exported as public interface.
|
|
|
|
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, flash, send_file, send_from_directory, \
|
2016-11-09 19:24:33 +01:00
|
|
|
get_flashed_messages, get_template_attribute, make_response, safe_join, \
|
|
|
|
stream_with_context
|
2015-08-02 20:59:11 +02:00
|
|
|
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, copy_current_request_context
|
|
|
|
from .blueprints import Blueprint
|
|
|
|
from .templating import render_template, render_template_string
|
|
|
|
|
|
|
|
# the signals
|
|
|
|
from .signals import signals_available, template_rendered, request_started, \
|
|
|
|
request_finished, got_request_exception, request_tearing_down, \
|
|
|
|
appcontext_tearing_down, appcontext_pushed, \
|
2016-11-09 19:24:33 +01:00
|
|
|
appcontext_popped, message_flashed, before_render_template
|
2015-08-02 20:59:11 +02:00
|
|
|
|
|
|
|
# We're not exposing the actual json module but a convenient wrapper around
|
|
|
|
# it.
|
|
|
|
from . import json
|
|
|
|
|
|
|
|
# This was the only thing that flask used to export at one point and it had
|
|
|
|
# a more generic name.
|
|
|
|
jsonify = json.jsonify
|
|
|
|
|
|
|
|
# backwards compat, goes away in 1.0
|
|
|
|
from .sessions import SecureCookieSession as Session
|
|
|
|
json_available = True
|