mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-09 16:01:28 +00:00
Replace LpApiWrapper.getUbuntuSourcePackage() with
Distribution('ubuntu').getArchive().getSourcePackage()
This commit is contained in:
parent
a49e4f6d43
commit
54e9563e92
@ -33,7 +33,7 @@ import urllib2
|
|||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
# ubuntu-dev-tools modules.
|
# ubuntu-dev-tools modules.
|
||||||
from ubuntutools.lp.lpapicache import LpApiWrapper, Distribution
|
from ubuntutools.lp.lpapicache import Distribution
|
||||||
from ubuntutools.lp.udtexceptions import SeriesNotFoundException, PackageNotFoundException
|
from ubuntutools.lp.udtexceptions import SeriesNotFoundException, PackageNotFoundException
|
||||||
|
|
||||||
if not os.path.exists("/usr/bin/dget"):
|
if not os.path.exists("/usr/bin/dget"):
|
||||||
@ -81,7 +81,7 @@ if __name__ == '__main__':
|
|||||||
# Arguments are correct, proceed.
|
# Arguments are correct, proceed.
|
||||||
# Check that the Ubuntu release and package specified exists.
|
# Check that the Ubuntu release and package specified exists.
|
||||||
try:
|
try:
|
||||||
LpApiWrapper.getUbuntuSourcePackage(package, release)
|
Distribution('ubuntu').getArchive().getSourcePackage(package, release)
|
||||||
except (SeriesNotFoundException, PackageNotFoundException), e:
|
except (SeriesNotFoundException, PackageNotFoundException), e:
|
||||||
print e
|
print e
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -121,7 +121,7 @@ def checkExistingReports(package):
|
|||||||
def cur_version_component(sourcepkg, release):
|
def cur_version_component(sourcepkg, release):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
src = LpApiWrapper.getUbuntuSourcePackage(sourcepkg, release)
|
src = Distribution('ubuntu').getArchive().getSourcePackage(sourcepkg, release)
|
||||||
return (src.getVersion(), src.getComponent())
|
return (src.getVersion(), src.getComponent())
|
||||||
|
|
||||||
except udtexceptions.PackageNotFoundException:
|
except udtexceptions.PackageNotFoundException:
|
||||||
|
@ -58,16 +58,6 @@ class LpApiWrapper(object):
|
|||||||
ubuntu-dev-tools.
|
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
|
@classmethod
|
||||||
def canUploadPackage(cls, srcpkg, series = None):
|
def canUploadPackage(cls, srcpkg, series = None):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user