changeset 18:9fac43403d7e

stub out a function to get unique components
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 07 Dec 2010 10:21:08 -0800
parents 7fe6f1e923bb
children 9090fe0cdb72
files bzconsole/main.py
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bzconsole/main.py	Tue Dec 07 09:16:07 2010 -0800
+++ b/bzconsole/main.py	Tue Dec 07 10:21:08 2010 -0800
@@ -56,6 +56,20 @@
         assert product in configuration['product'], 'Product %s not found' % product
         return sorted(configuration['product'][product]['component'].keys())
 
+    def _unique_components(self):
+        """returns a dict of unique component, product"""
+        retval = {}
+        dupe = set()
+        for product in self.products():
+            for component in self.components(product):
+                if component in retval:
+                    dupe.add(component)
+                else:
+                    retval[component] = product
+        for d in dupe:
+            del retval[d]
+        return retval
+
     def new(self, product, component, title, version=None, description=None):
         """file a new bug. username and password must be set"""