Add BinaryPackagePublishingHistory to lpapicache

This commit is contained in:
Stefano Rivera 2011-11-15 01:50:04 +02:00
parent dd7c37e130
commit 2e217ac51e
2 changed files with 38 additions and 2 deletions

View File

@ -146,8 +146,8 @@ def locate_package(package, distribution):
def request_backport(package_spph, source, destinations):
published_binaries = set()
for bpph in package_spph._lpobject.getPublishedBinaries():
published_binaries.add(bpph.binary_package_name)
for bpph in package_spph.getBinaries():
published_binaries.add(bpph.getPackageName())
testing = []
testing += ["You can test-build the backport in your PPA with "

View File

@ -352,6 +352,7 @@ class SourcePackagePublishingHistory(BaseWrapper):
def __init__(self, *args):
self._changelog = None
self._binaries = None
# Don't share _builds between different
# SourcePackagePublishingHistory objects
if '_builds' not in self.__dict__:
@ -408,6 +409,16 @@ class SourcePackagePublishingHistory(BaseWrapper):
new_entries.append(unicode(block))
return u''.join(new_entries)
def getBinaries(self):
'''
Returns the resulting BinaryPackagePublishingHistorys
'''
if self._binaries is None:
self._binaries = [BinaryPackagePublishingHistory(bpph)
for bpph in
self._lpobject.getPublishedBinaries()]
return self._binaries
def _fetch_builds(self):
'''Populate self._builds with the build records.'''
builds = self.getBuilds()
@ -460,6 +471,31 @@ class SourcePackagePublishingHistory(BaseWrapper):
self.getPackageName(), '\n'.join(res))
class BinaryPackagePublishingHistory(BaseWrapper):
'''
Wrapper class around a LP binary package object.
'''
resource_type = 'binary_package_publishing_history'
def getPackageName(self):
'''
Returns the binary package name.
'''
return self._lpobject.binary_package_name
def getVersion(self):
'''
Returns the version of the binary package.
'''
return self._lpobject.binary_package_version
def getComponent(self):
'''
Returns the component of the binary package.
'''
return self._lpobject.component_name
class MetaPersonTeam(MetaWrapper):
@property
def me(cls):