~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/vocabularies.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-07-22 02:25:33 UTC
  • mfrom: (13479.2.9 destroy-bugtask-markers)
  • Revision ID: launchpad@pqm.canonical.com-20110722022533-a76fv2t482ortydn
[incr] [r=sinzui][bug=80902] Remove most uses of the I*BugTask marker
        interfaces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
from lp.app.browser.tales import DateTimeFormatterAPI
129
129
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
130
130
from lp.blueprints.interfaces.specification import ISpecification
131
 
from lp.bugs.interfaces.bugtask import (
132
 
    IBugTask,
133
 
    IDistroBugTask,
134
 
    IDistroSeriesBugTask,
135
 
    IProductSeriesBugTask,
136
 
    IUpstreamBugTask,
137
 
    )
 
131
from lp.bugs.interfaces.bugtask import IBugTask
138
132
from lp.registry.interfaces.distribution import IDistribution
139
133
from lp.registry.interfaces.distributionsourcepackage import (
140
134
    IDistributionSourcePackage,
1458
1452
    @staticmethod
1459
1453
    def getMilestoneTarget(milestone_context):
1460
1454
        """Return the milestone target."""
1461
 
        if IUpstreamBugTask.providedBy(milestone_context):
1462
 
            target = milestone_context.product
1463
 
        elif IDistroBugTask.providedBy(milestone_context):
1464
 
            target = milestone_context.distribution
1465
 
        elif IDistroSeriesBugTask.providedBy(milestone_context):
1466
 
            target = milestone_context.distroseries
1467
 
        elif IProductSeriesBugTask.providedBy(milestone_context):
1468
 
            target = milestone_context.productseries.product
 
1455
        if IBugTask.providedBy(milestone_context):
 
1456
            bug_target = milestone_context.target
 
1457
            if IProduct.providedBy(bug_target):
 
1458
                target = milestone_context.product
 
1459
            elif IProductSeries.providedBy(bug_target):
 
1460
                target = milestone_context.productseries.product
 
1461
            elif (IDistribution.providedBy(bug_target) or
 
1462
                  IDistributionSourcePackage.providedBy(bug_target)):
 
1463
                target = milestone_context.distribution
 
1464
            elif (IDistroSeries.providedBy(bug_target) or
 
1465
                  ISourcePackage.providedBy(bug_target)):
 
1466
                target = milestone_context.distroseries
1469
1467
        elif IDistributionSourcePackage.providedBy(milestone_context):
1470
1468
            target = milestone_context.distribution
1471
1469
        elif ISourcePackage.providedBy(milestone_context):