diff --git a/requestbackport b/requestbackport index 1f9a4be..14c57e5 100755 --- a/requestbackport +++ b/requestbackport @@ -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 " diff --git a/ubuntutools/lp/lpapicache.py b/ubuntutools/lp/lpapicache.py index 7e84869..11dac36 100644 --- a/ubuntutools/lp/lpapicache.py +++ b/ubuntutools/lp/lpapicache.py @@ -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):