def distributionsourcepackage(self): """See IDistributionSourcePackageCache.""" # import here to avoid circular imports from lp.registry.model.distributionsourcepackage import ( DistributionSourcePackage) return DistributionSourcePackage(self.distribution, self.sourcepackagename)
def translation_target(self): """See `ICustomLanguageCode`.""" # Avoid circular imports from lp.registry.model.distributionsourcepackage import ( DistributionSourcePackage) if self.product: return self.product else: return DistributionSourcePackage(self.distribution, self.sourcepackagename)
def target(self): """See `IStructuralSubscription`.""" if self.product is not None: return self.product elif self.productseries is not None: return self.productseries elif self.project is not None: return self.project elif self.milestone is not None: return self.milestone elif self.distribution is not None: if self.sourcepackagename is not None: # Circular imports. from lp.registry.model.distributionsourcepackage import ( DistributionSourcePackage) return DistributionSourcePackage( self.distribution, self.sourcepackagename) else: return self.distribution elif self.distroseries is not None: return self.distroseries else: raise AssertionError('StructuralSubscription has no target.')