mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-09 16:01:28 +00:00
ubuntutools/lp/functions.py: Improved error messages, and made prettier functions.
This commit is contained in:
parent
c9e4293dea
commit
a876414c25
@ -30,6 +30,9 @@ from re import findall
|
|||||||
# Takes time to initialise - move to top level so we only pay the penalty
|
# 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
|
# once. Should probably make this a proper class so we can instansiate
|
||||||
# singleton-style (lazily).
|
# singleton-style (lazily).
|
||||||
|
#
|
||||||
|
# TODO: FIXME: Kill the below - massive overhead.
|
||||||
|
#
|
||||||
launchpad = lp_libsupport.get_launchpad("ubuntu-dev-tools")
|
launchpad = lp_libsupport.get_launchpad("ubuntu-dev-tools")
|
||||||
|
|
||||||
def ubuntuDevelopmentSeries():
|
def ubuntuDevelopmentSeries():
|
||||||
@ -38,6 +41,10 @@ def ubuntuDevelopmentSeries():
|
|||||||
ubuntu = launchpad.distributions['ubuntu']
|
ubuntu = launchpad.distributions['ubuntu']
|
||||||
return ubuntu.current_series.name
|
return ubuntu.current_series.name
|
||||||
|
|
||||||
|
def doesUbuntuReleaseExist(name):
|
||||||
|
""" Prettier name to use for _ubuntuSeries() """
|
||||||
|
_ubuntuSeries(name)
|
||||||
|
|
||||||
def _ubuntuSeries(name):
|
def _ubuntuSeries(name):
|
||||||
""" Get the LP representation of a series
|
""" Get the LP representation of a series
|
||||||
|
|
||||||
@ -52,7 +59,7 @@ def _ubuntuSeries(name):
|
|||||||
|
|
||||||
except launchpadlib.errors.HTTPError:
|
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):
|
def _ubuntuSourcePackage(package, series):
|
||||||
""" Finds an Ubuntu source package on LP
|
""" Finds an Ubuntu source package on LP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user