2015-08-02 20:59:11 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
flask.ext
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
Redirect imports for extensions. This module basically makes it possible
|
|
|
|
for us to transition from flaskext.foo to flask_foo without having to
|
|
|
|
force all extensions to upgrade at the same time.
|
|
|
|
|
|
|
|
When a user does ``from flask.ext.foo import bar`` it will attempt to
|
|
|
|
import ``from flask_foo import bar`` first and when that fails it will
|
|
|
|
try to import ``from flaskext.foo import bar``.
|
|
|
|
|
|
|
|
We're switching from namespace packages because it was just too painful for
|
|
|
|
everybody involved.
|
|
|
|
|
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.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def setup():
|
|
|
|
from ..exthook import ExtensionImporter
|
|
|
|
importer = ExtensionImporter(['flask_%s', 'flaskext.%s'], __name__)
|
|
|
|
importer.install()
|
|
|
|
|
|
|
|
|
|
|
|
setup()
|
|
|
|
del setup
|