Package pyamf :: Package adapters
[hide private]
[frames] | no frames]

Package adapters

source code

The adapter package provides additional functionality for other Python packages. This includes registering classes, setting up type maps etc.


Since: 0.1.0

Submodules [hide private]

Classes [hide private]
  PackageImporter
Package importer used for lazy module loading.
Functions [hide private]
 
register_adapters() source code
 
register_adapter(mod, func)
Registers a callable to be executed when a module is imported.
source code
Variables [hide private]
  adapters_registered = True

Imports: os, glob, imports, _array, util


Function Details [hide private]

register_adapter(mod, func)

source code 

Registers a callable to be executed when a module is imported. If the module already exists then the callable will be executed immediately. You can register the same module multiple times, the callables will be executed in the order they were registered. The root module must exist (i.e. be importable) otherwise an ImportError will be thrown.

Parameters:
  • mod (str) - The fully qualified module string, as used in the imports statement. E.g. 'foo.bar.baz'. The string must map to a module otherwise the callable will not fire.
  • func (callable) - The function to call when mod is imported. This function must take one arg, the newly imported module object.
Raises:
  • TypeError - func must be callable