changeset 11:9b90cf893943

default configuration file
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 04 Dec 2012 15:35:54 -0800
parents f0bca08e296a
children c0e50e040275
files mozillatry.py
diffstat 1 files changed, 7 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/mozillatry.py	Tue Dec 04 15:28:31 2012 -0800
+++ b/mozillatry.py	Tue Dec 04 15:35:54 2012 -0800
@@ -104,27 +104,13 @@
         if (not self.config.get('opt')) and (not self.config.get('debug')):
             raise ConfigurationError("Must have opt or debug builds")
 
-
-def read_config(filename, options):
-    """read .mozutils config file and substitute for options if None"""
-
-    # XXX stub; this should really use
-    # e.g. http://k0s.org/mozilla/hg/configuration/
-    from ConfigParser import ConfigParser
-    parser = ConfigParser()
-    if not os.path.exists(filename):
-        return parser
-    parser.read(filename)
-    if options.mozilla_central is None:
-        try:
-            path = parser.get('hg', 'mozilla-central')
-            if path:
-                options.mozilla_central = os.path.expanduser(path)
-        except Exception: # XXX temporary hack
-            pass
-    return parser
-
-
+    def configuration_files(self, options, args):
+        configuration_files = configuration.Configuration(self, options, args)
+        if not configuration_files:
+            default_config = os.path.expanduser(default_config_file)
+            if os.path.exists(default_config):
+                configuration_files = [default_config]
+        return configuration_files
 
 def main(args=sys.argv[1:]):