3
0
mirror of https://git.launchpad.net/ubuntu-dev-tools synced 2025-04-22 07:41:08 +00:00

Replace LpApiWrapper.getUbuntuSourcePackage() with

Distribution('ubuntu').getArchive().getSourcePackage()
This commit is contained in:
Michael Bienia 2009-08-04 15:53:49 +02:00
parent a49e4f6d43
commit 54e9563e92
3 changed files with 3 additions and 13 deletions

@ -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)

@ -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:

@ -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):
'''