Mercurial > hg > configuration
changeset 120:4c7f93ce302a
separate loading configuration files to its own method for consumers
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 04 Dec 2012 16:17:55 -0800 |
parents | f103c93690fb |
children | 919cee3e3ed0 |
files | configuration/configuration.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/configuration/configuration.py Tue Dec 04 15:37:34 2012 -0800 +++ b/configuration/configuration.py Tue Dec 04 16:17:55 2012 -0800 @@ -444,6 +444,10 @@ configuration_files = [configuration_files] return configuration_files + def load_configuration_file(self, filename): + """load a configuration file""" + return self.deserialize(filename) + def read_configuration_files(self, options, args): """deserialize configuration""" @@ -455,7 +459,7 @@ config = [] for f in configuration_files: try: - loaded_config = self.deserialize(f) + loaded_config = self.load_configuration_file(f) if loaded_config: config.append(loaded_config) except BaseException, e: @@ -464,6 +468,7 @@ def parse_args(self, *args, **kw): + # parse command line options self.parsed = dict() options, args = optparse.OptionParser.parse_args(self, *args, **kw)