mozilla/configman — pull request #6 by twobraids (2011-12-01 16:27:27+00:00)
Title: Aggregation - comments requested

This is the implementation of a proposal to add aggregations to configman. The idea is to add meta entries to the configuration that are aggregations of other entries. Aggregations are comprised of a name and a function that returns the aggregation value. The function must accept three parameters and can return any type of object:

1) a dict that represents the whole configuration (the output of config.get_config())
2) a dict that represents the local config (the namespace in which the aggregation object lives)
3) a list of command line arguments (those that are not associated with command line switches)

This concept came from a desire to create factory objects in configuration that require input from more than one configuration option. See .../demo/trans_generator.py for an example of a really cool database transaction factory using this idea.