From 54e9563e92c9d5e5401f1bce0504a85aa6fd9fcd Mon Sep 17 00:00:00 2001 From: Michael Bienia Date: Tue, 4 Aug 2009 15:53:49 +0200 Subject: [PATCH] Replace LpApiWrapper.getUbuntuSourcePackage() with Distribution('ubuntu').getArchive().getSourcePackage() --- pull-lp-source | 4 ++-- requestsync | 2 +- ubuntutools/lp/lpapicache.py | 10 ---------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/pull-lp-source b/pull-lp-source index 6e4556c..f96ac8d 100755 --- a/pull-lp-source +++ b/pull-lp-source @@ -33,7 +33,7 @@ import urllib2 from optparse import OptionParser # ubuntu-dev-tools modules. -from ubuntutools.lp.lpapicache import LpApiWrapper, Distribution +from ubuntutools.lp.lpapicache import Distribution from ubuntutools.lp.udtexceptions import SeriesNotFoundException, PackageNotFoundException if not os.path.exists("/usr/bin/dget"): @@ -81,7 +81,7 @@ if __name__ == '__main__': # Arguments are correct, proceed. # Check that the Ubuntu release and package specified exists. try: - LpApiWrapper.getUbuntuSourcePackage(package, release) + Distribution('ubuntu').getArchive().getSourcePackage(package, release) except (SeriesNotFoundException, PackageNotFoundException), e: print e sys.exit(1) diff --git a/requestsync b/requestsync index 1ddd5e6..0b5f43d 100755 --- a/requestsync +++ b/requestsync @@ -121,7 +121,7 @@ def checkExistingReports(package): def cur_version_component(sourcepkg, release): try: - src = LpApiWrapper.getUbuntuSourcePackage(sourcepkg, release) + src = Distribution('ubuntu').getArchive().getSourcePackage(sourcepkg, release) return (src.getVersion(), src.getComponent()) except udtexceptions.PackageNotFoundException: diff --git a/ubuntutools/lp/lpapicache.py b/ubuntutools/lp/lpapicache.py index 3eeb9ef..55b250a 100644 --- a/ubuntutools/lp/lpapicache.py +++ b/ubuntutools/lp/lpapicache.py @@ -58,16 +58,6 @@ class LpApiWrapper(object): ubuntu-dev-tools. ''' - @classmethod - def getUbuntuSourcePackage(cls, name, series, pocket = 'Release'): - ''' - Finds an Ubuntu source package on LP. - - Returns a wrapped LP representation of the source package. - If the package does not exist: raise PackageNotFoundException - ''' - return Distribution('ubuntu').getArchive().getSourcePackage(name, series, pocket) - @classmethod def canUploadPackage(cls, srcpkg, series = None): '''