def _getSST(self): if IStructuralSubscriptionTarget.providedBy(self.context): sst = self.context else: # self.context is a view, and the target is its context sst = self.context.context return sst
def get_structural_subscription_targets(bugtasks): """Return (bugtask, target) pairs for each target of the bugtasks. Each bugtask may be responsible theoretically for 0 or more targets. In practice, each generates one, two or three. """ for bugtask in bugtasks: if IStructuralSubscriptionTarget.providedBy(bugtask.target): yield (bugtask, bugtask.target) if bugtask.target.parent_subscription_target is not None: yield (bugtask, bugtask.target.parent_subscription_target) # This can probably be an elif. Determining conclusively # whether it can be is not a priority at this time. The # docstring says one, two, or three targets per bugtask because # of the belief that this could be an elif; otherwise, it would # be one, two, three or four. if ISourcePackage.providedBy(bugtask.target): # Distribution series bug tasks with a package have the source # package set as their target, so we add the distroseries # explicitly to the set of subscription targets. yield (bugtask, bugtask.distroseries) if bugtask.milestone is not None: yield (bugtask, bugtask.milestone)
def parent_subscription_target(self): """See `IStructuralSubscriptionTarget`.""" parent = self.__helper.target_parent assert parent is None or IStructuralSubscriptionTarget.providedBy(parent) return parent
def parent_subscription_target(self): """See `IStructuralSubscriptionTarget`.""" parent = self.__helper.target_parent assert (parent is None or IStructuralSubscriptionTarget.providedBy(parent)) return parent