Package web2py :: Package gluon :: Module custom_import :: Class _Web2pyImporter
[hide private]
[frames] | no frames]

Class _Web2pyImporter

source code

   object --+    
            |    
_BaseImporter --+
                |
               _Web2pyImporter
Known Subclasses:
_Web2pyDateTrackerImporter

The standard web2py importer. Like the standard Python importer but it tries to transform import statements as something like "import applications.app_name.modules.x". If the import failed, fall back on _BaseImporter.

Instance Methods [hide private]
 
__init__(self, web2py_path)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_matchAppDir(self, file_path)
Does the file in a directory inside the "applications" directory?
source code
 
__call__(self, name, globals={}, locals={}, fromlist=[], level=-1)
The import method itself.
source code
 
__import__dot(self, prefix, name, globals, locals, fromlist, level)
Here we will import x.y.z as many imports like: from applications.app_name.modules import x from applications.app_name.modules.x import y from applications.app_name.modules.x.y import z.
source code
 
_Web2pyImporter__import__dot(self, prefix, name, globals, locals, fromlist, level)
Here we will import x.y.z as many imports like: from applications.app_name.modules import x from applications.app_name.modules.x import y from applications.app_name.modules.x.y import z.
source code

Inherited from _BaseImporter: begin, end

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  _RE_ESCAPED_PATH_SEP = '\\/'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, web2py_path)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • web2py_path - The absolute path of the web2py installation.
Overrides: object.__init__

__call__(self, name, globals={}, locals={}, fromlist=[], level=-1)
(Call operator)

source code 
The import method itself.
Overrides: _BaseImporter.__call__

__import__dot(self, prefix, name, globals, locals, fromlist, level)

source code 
Here we will import x.y.z as many imports like: from applications.app_name.modules import x from applications.app_name.modules.x import y from applications.app_name.modules.x.y import z. x will be the module returned.

_Web2pyImporter__import__dot(self, prefix, name, globals, locals, fromlist, level)

source code 
Here we will import x.y.z as many imports like: from applications.app_name.modules import x from applications.app_name.modules.x import y from applications.app_name.modules.x.y import z. x will be the module returned.