changeset 28:a46a76a7990d

fix single version products and bump version
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 05 Apr 2012 08:51:33 -0700
parents d5e88dadde69
children c412148c8c1e
files bzconsole/api.py setup.py
diffstat 2 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/bzconsole/api.py	Fri Jan 27 14:10:03 2012 -0800
+++ b/bzconsole/api.py	Thu Apr 05 08:51:33 2012 -0700
@@ -84,22 +84,26 @@
 
         # sanity check
         if product:
-          assert product in self.products(), "Product not found"
-          assert component in self.components(product), "Component not found"
+            assert product in self.products(), "Product not found"
+            assert component in self.components(product), "Component not found"
         else:
-          unique, dupe = self._unique_components()
-          assert component in unique, 'Unique component not found: %s' % component
-          product = unique[component]
+            unique, dupe = self._unique_components()
+            assert component in unique, 'Unique component not found: %s' % component
+            product = unique[component]
         assert title, 'Must provide a bug summary'
         assert self.username and self.password, "Must be authenticated"
 
         # infer version if not given
         if version is None:
-            default_versions = ('unspecified', 'Trunk')
-            for ver in default_versions:
-                version = ver
-                if version in self._configuration['product'][product]['version']:
-                    break
+            versions = self._configuration['product'][product]['version']
+            if len(versions) == 1:
+                version = versions[0]
+            else:
+                default_versions = ('unspecified', 'Trunk')
+                for ver in default_versions:
+                    version = ver
+                    if version in self._configuration['product'][product]['version']:
+                        break
         assert version in self._configuration['product'][product]['version'], 'Version not found'
 
         # create the needed data structure
--- a/setup.py	Fri Jan 27 14:10:03 2012 -0800
+++ b/setup.py	Thu Apr 05 08:51:33 2012 -0700
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 import sys, os
 
-version = '0.2.1'
+version = '0.2.2'
 
 readme = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.txt')