mozilla/configman — pull request #70 by twobraids (2013-03-04 17:06:18+00:00)
Title: added migration feature

This is a major change to the inner workings of configman it addresses these nagging issues:

1) unnecessary dependency loading: in previous versions of configman, the converter functions associated with Option objects would be called immediately (and repeatedly) on string values. This was unacceptable when the string represented a class to be loaded. If the class represented a default (such as HBase) that was to be overwritten by a config file, there is no reason to load the default module.

The change was implemented by rewriting the recursive overlaying/expansion methods of the ConfigurationManager class. It now only loads modules after all the overlaying is complete. This actually simplified the process. See ``config_manager.py:473`` for the new routines.

2) exploit the new DotDict breadth first traversal method: previous versions of the ConfigurationManager had several recursive methods that walked the tree of option definitions. These functions were opaque at best. The previous PR to this one added tree traversal to the DotDict base class resulting in significant simplifications of the methods in ConfigurationManager that needed traversals.

3) add option migration to config file writing: rather than have values repeated in nested namespaces, it is now legal to save them in lower level namespaces. Writing `.ini` or `.conf` files supports this directly and automatically.

These three enhancements are intimately intertwined. They depend on each other so splitting them into separate PRs was not practical. Do not be intimidated by the size of this PR - this is more code simplification than it looks.