A registry for library configuration values.
def google.appengine.api.lib_config.LibConfigRegistry.__init__ |
( |
|
self, |
|
|
|
modname |
|
) |
| |
Constructor.
Args:
modname: The module name to be imported.
Note: the actual import of this module is deferred until the first
time a configuration value is requested through attribute access
on a ConfigHandle instance.
def google.appengine.api.lib_config.LibConfigRegistry.initialize |
( |
|
self, |
|
|
|
import_func = __import__ |
|
) |
| |
Attempt to import the config module, if not already imported.
This function always sets self._module to a value unequal
to None: either the imported module (if imported successfully), or
a dummy object() instance (if an ImportError was raised). Other
exceptions are *not* caught.
When a dummy instance is used, it is also put in sys.modules.
This allows us to detect when sys.modules was changed (as
dev_appserver.py does when it notices source code changes) and
re-try the __import__ in that case, while skipping it (for speed)
if nothing has changed.
Args:
import_func: Used for dependency injection.
def google.appengine.api.lib_config.LibConfigRegistry.register |
( |
|
self, |
|
|
|
prefix, |
|
|
|
mapping |
|
) |
| |
Register a set of configuration names.
Args:
prefix: A shared prefix for the configuration names being registered.
If the prefix doesn't end in '_', that character is appended.
mapping: A dict mapping suffix strings to default values.
Returns:
A ConfigHandle instance.
It's okay to re-register the same prefix: the mappings are merged,
and for duplicate suffixes the most recent registration wins.
def google.appengine.api.lib_config.LibConfigRegistry.reset |
( |
|
self | ) |
|
Drops the imported config module.
If the config module has not been imported then this is a no-op.
The documentation for this class was generated from the following file:
- code/googleappengine-read-only/python/google/appengine/api/lib_config.py