__init__.py
This file
Path
flask/ext/__init__.py
29 lines · 842 bytes · Python
Last changed by
Refactored flask.ext process to not swallow exceptions on weird Pythons.Armin Ronacherbefore adoption95c4dcb
History of this fileTake it
1# -*- coding: utf-8 -*-2"""3 flask.ext4 ~~~~~~~~~56 Redirect imports for extensions. This module basically makes it possible7 for us to transition from flaskext.foo to flask_foo without having to8 force all extensions to upgrade at the same time.910 When a user does ``from flask.ext.foo import bar`` it will attempt to11 import ``from flask_foo import bar`` first and when that fails it will12 try to import ``from flaskext.foo import bar``.1314 We're switching from namespace packages because it was just too painful for15 everybody involved.1617 :copyright: (c) 2011 by Armin Ronacher.18 :license: BSD, see LICENSE for more details.19"""202122def setup():23 from ..exthook import ExtensionImporter24 importer = ExtensionImporter(['flask_%s', 'flaskext.%s'], __name__)25 importer.install()262728setup()29del setup