custom_import Module

This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>

Support for smart import syntax for web2py applications

exception gluon.custom_import.CustomImportException[source]

Bases: exceptions.ImportError

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_import_install()[source]
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

gluon.custom_import.is_tracking_changes()[source]
gluon.custom_import.track_changes(track=True)[source]