# HG changeset patch # User Jeff Hammel # Date 1333641093 25200 # Node ID a46a76a7990d5999554fee42fc8575a481c6ab76 # Parent d5e88dadde69d5e15a5b501ba2a16a0eea331606 fix single version products and bump version diff -r d5e88dadde69 -r a46a76a7990d bzconsole/api.py --- 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 diff -r d5e88dadde69 -r a46a76a7990d setup.py --- 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')