# HG changeset patch # User Jeff Hammel # Date 1288720949 25200 # Node ID 9ee7b8236c36aae5a29d41028e9d966c95ed3e00 # Parent 7830ec1f5dcd5e4b9fd6e9c79ae6349ff9bf6707 now can list products and components diff -r 7830ec1f5dcd -r 9ee7b8236c36 bzconsole/main.py --- a/bzconsole/main.py Tue Nov 02 10:41:16 2010 -0700 +++ b/bzconsole/main.py Tue Nov 02 11:02:29 2010 -0700 @@ -22,17 +22,19 @@ self.server = server def products(self, classification=None): - """list bugzailla products""" + """list bugzilla products""" configuration = self._configuration() if classification: - raise NotImplementedError + products = [i for i in configuration['product'] if configuration['product'][i]['classification'] == 'Components'] + return sorted(products) else: return sorted(configuration['product'].keys()) def components(self, product): """list bugzilla components for a particular product""" configuration = self._configuration() - raise NotImplementedError + assert product in configuration['product'], 'Product %s not found' % product + return sorted(configuration['product'][product]['component'].keys()) def _configuration(self): if not hasattr(self, '__configuration'):