~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/interfaces/distroseriesparent.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-05-23 18:43:31 UTC
  • mfrom: (13084.2.6 page-match-rewrite-url)
  • Revision ID: launchpad@pqm.canonical.com-20110523184331-dhd2c7cgfuu49epw
[r=sinzui][bug=784273] Adds facility to the PageMatch to handle bad
        URIs

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
from lazr.restful.fields import Reference
16
16
from zope.interface import Interface
17
17
from zope.schema import (
 
18
    Int,
18
19
    Bool,
19
 
    Choice,
20
 
    Int,
21
20
    )
22
21
 
23
22
from canonical.launchpad import _
24
23
from lp.registry.interfaces.distroseries import IDistroSeries
25
 
from lp.registry.interfaces.pocket import PackagePublishingPocket
26
24
 
27
25
 
28
26
class IDistroSeriesParent(Interface):
44
42
            "Whether or not the derived_series has been populated with "
45
43
            "packages from its parent_series."))
46
44
 
47
 
    is_overlay = Bool(
48
 
        title=_("Is this relationship an overlay?"), required=True,
49
 
        default=False)
50
 
 
51
 
    pocket = Choice(
52
 
        title=_("The pocket for this overlay"), required=False,
53
 
        vocabulary=PackagePublishingPocket)
54
 
 
55
 
    component = Choice(
56
 
        title=_("The component for this overlay"), required=False,
57
 
        vocabulary='Component')
58
 
 
59
45
 
60
46
class IDistroSeriesParentSet(Interface):
61
47
    """`DistroSeriesParentSet` interface."""
62
48
 
63
 
    def new(derived_series, parent_series, initialized, is_overlay=False,
64
 
            pocket=None, component=None):
 
49
    def new(derived_series, parent_series, initialized):
65
50
        """Create a new `DistroSeriesParent`."""
66
51
 
67
52
    def getByDerivedSeries(derived_series):
75
60
 
76
61
        :param parent_series: An `IDistroseries`
77
62
        """
78
 
 
79
 
    def getByDerivedAndParentSeries(self, derived_series, parent_series):
80
 
        """Get the `DistroSeriesParent` by derived and parent series.
81
 
 
82
 
        :param derived_series: The derived `IDistroseries`
83
 
        :param parent_series: The parent `IDistroseries`
84
 
        """
85
 
 
86
 
    def getFlattenedOverlayTree(derived_series):
87
 
        """Get the list of DistroSeriesParents corresponding to the
88
 
        flattened overlay tree.
89
 
 
90
 
        :param parent_series: An `IDistroseries`.
91
 
        :return: A list of `IDistroSeriesParents`.
92
 
 
93
 
        For instance, given the following structure:
94
 
 
95
 
                     series               type of relation:
96
 
                       |                    |           |
97
 
            -----------------------         |           o
98
 
            |          |          |         |           |
99
 
            o          o          |      no overlay  overlay
100
 
            |          |          |
101
 
        parent1    parent2    parent3
102
 
 
103
 
        The result would be:
104
 
        [dsp(series, parent1), dsp(series, parent2)]
105
 
        """