custom_import
Module¶
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Support for smart import syntax for web2py applications¶
-
class
gluon.custom_import.
TrackImporter
[source]¶ Bases:
object
An importer tracking the date of the module files and reloading them when they are changed.
-
PACKAGE_PATH_SUFFIX
= '/__init__.py'¶
-
THREAD_LOCAL
= <thread._local object>¶
-
-
gluon.custom_import.
custom_importer
(name, globals=None, locals=None, fromlist=None, level=-1)[source]¶ web2py’s custom importer. It behaves like the standard Python importer but it tries to transform import statements as something like “import applications.app_name.modules.x”. If the import fails, it falls back on naive_importer