Python Paste


DispatchingConfig

This is a configuration object that can be used globally, imported, have references held onto. The configuration may differ by thread (or may not).

Specific configurations are registered (and deregistered) either for the process or for threads.


Methods

f __init__(self) ...

f push_thread_config(self, conf) ...

Make conf the active configuration for this thread. Thread-local configuration always overrides process-wide configuration.

This should be used like:

conf = make_conf()
dispatching_config.push_thread_config(conf)
try:
    ... do stuff ...
finally:
    dispatching_config.pop_thread_config(conf)

f pop_thread_config(self, conf=None) ...

Remove a thread-local configuration. If conf is given, it is checked against the popped configuration and an error is emitted if they don't match.

f push_process_config(self, conf) ...

Like push_thread_config, but applies the configuration to the entire process.

f pop_process_config(self, conf=None) ...

f current_conf(self) ...

f __getitem__(self, key) ...

f __contains__(self, key) ...

f __setitem__(self, key, value) ...

See the source for more information.