From a876414c25aeb72b3dc5d0157cb0afab312963d8 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Wed, 27 May 2009 18:07:46 -0400 Subject: [PATCH] ubuntutools/lp/functions.py: Improved error messages, and made prettier functions. --- ubuntutools/lp/functions.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ubuntutools/lp/functions.py b/ubuntutools/lp/functions.py index 02b6ee8..4ff0076 100644 --- a/ubuntutools/lp/functions.py +++ b/ubuntutools/lp/functions.py @@ -30,6 +30,9 @@ from re import findall # Takes time to initialise - move to top level so we only pay the penalty # once. Should probably make this a proper class so we can instansiate # singleton-style (lazily). +# +# TODO: FIXME: Kill the below - massive overhead. +# launchpad = lp_libsupport.get_launchpad("ubuntu-dev-tools") def ubuntuDevelopmentSeries(): @@ -38,6 +41,10 @@ def ubuntuDevelopmentSeries(): ubuntu = launchpad.distributions['ubuntu'] return ubuntu.current_series.name +def doesUbuntuReleaseExist(name): + """ Prettier name to use for _ubuntuSeries() """ + _ubuntuSeries(name) + def _ubuntuSeries(name): """ Get the LP representation of a series @@ -52,7 +59,7 @@ def _ubuntuSeries(name): except launchpadlib.errors.HTTPError: - raise SeriesNotFoundException('The series %s was not found' % name) + raise SeriesNotFoundException("Error: Unknown Ubuntu release: '%s'." % name) def _ubuntuSourcePackage(package, series): """ Finds an Ubuntu source package on LP