Mercurial > mozilla > hg > MozillaTry
comparison mozillatry.py @ 11:9b90cf893943
default configuration file
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 04 Dec 2012 15:35:54 -0800 |
parents | f0bca08e296a |
children | c0e50e040275 |
comparison
equal
deleted
inserted
replaced
10:f0bca08e296a | 11:9b90cf893943 |
---|---|
102 configuration.Configuration.validate(self) | 102 configuration.Configuration.validate(self) |
103 | 103 |
104 if (not self.config.get('opt')) and (not self.config.get('debug')): | 104 if (not self.config.get('opt')) and (not self.config.get('debug')): |
105 raise ConfigurationError("Must have opt or debug builds") | 105 raise ConfigurationError("Must have opt or debug builds") |
106 | 106 |
107 | 107 def configuration_files(self, options, args): |
108 def read_config(filename, options): | 108 configuration_files = configuration.Configuration(self, options, args) |
109 """read .mozutils config file and substitute for options if None""" | 109 if not configuration_files: |
110 | 110 default_config = os.path.expanduser(default_config_file) |
111 # XXX stub; this should really use | 111 if os.path.exists(default_config): |
112 # e.g. http://k0s.org/mozilla/hg/configuration/ | 112 configuration_files = [default_config] |
113 from ConfigParser import ConfigParser | 113 return configuration_files |
114 parser = ConfigParser() | |
115 if not os.path.exists(filename): | |
116 return parser | |
117 parser.read(filename) | |
118 if options.mozilla_central is None: | |
119 try: | |
120 path = parser.get('hg', 'mozilla-central') | |
121 if path: | |
122 options.mozilla_central = os.path.expanduser(path) | |
123 except Exception: # XXX temporary hack | |
124 pass | |
125 return parser | |
126 | |
127 | |
128 | 114 |
129 def main(args=sys.argv[1:]): | 115 def main(args=sys.argv[1:]): |
130 | 116 |
131 # parse command line arguments | 117 # parse command line arguments |
132 parser = MozillaTryConfiguration() | 118 parser = MozillaTryConfiguration() |