changeset 59:b8f066b8ab62

begin migration path towards inheriting from ConfigParser; ideally, Configuration should live in its own class and the CLI class should inherit from that
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 27 Mar 2012 15:41:02 -0700
parents f7dc5cf2540c
children 4f5ea5a8ccb0
files configuration/config.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configuration/config.py	Tue Mar 27 15:25:12 2012 -0700
+++ b/configuration/config.py	Tue Mar 27 15:41:02 2012 -0700
@@ -175,15 +175,16 @@
          None:  base_cli} # default
 __all__ += [i.__name__ for i in types.values()]
 
-class Configuration(object):
+class Configuration(optparse.OptionParser):
     """declarative configuration object"""
 
     options = {} # configuration basis
 
-    def __init__(self, configuration_providers=configuration_providers, types=types):
+    def __init__(self, configuration_providers=configuration_providers, types=types, **parser_args):
         self.config = {}
         self.configuration_providers = configuration_providers
         self.types = types
+        optparse.OptionParser.__init__(self, **parser_args)
 
     ### methods for iteration
     ### TODO: make this a real iterator