~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

Merge db-devel.

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
    Bool,
 
19
    Choice,
18
20
    Int,
19
 
    Bool,
20
21
    )
21
22
 
22
23
from canonical.launchpad import _
23
24
from lp.registry.interfaces.distroseries import IDistroSeries
 
25
from lp.registry.interfaces.pocket import PackagePublishingPocket
24
26
 
25
27
 
26
28
class IDistroSeriesParent(Interface):
42
44
            "Whether or not the derived_series has been populated with "
43
45
            "packages from its parent_series."))
44
46
 
 
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
 
45
59
 
46
60
class IDistroSeriesParentSet(Interface):
47
61
    """`DistroSeriesParentSet` interface."""
48
62
 
49
 
    def new(derived_series, parent_series, initialized):
 
63
    def new(derived_series, parent_series, initialized, is_overlay=False,
 
64
            pocket=None, component=None):
50
65
        """Create a new `DistroSeriesParent`."""
51
66
 
52
67
    def getByDerivedSeries(derived_series):
60
75
 
61
76
        :param parent_series: An `IDistroseries`
62
77
        """
 
78
 
 
79
    def getFlattenedOverlayTree(derived_series):
 
80
        """Get the list of DistroSeriesParents corresponding to the
 
81
        flattened overlay tree.
 
82
 
 
83
        :param parent_series: An `IDistroseries`.
 
84
        :return: A list of `IDistroSeriesParents`.
 
85
 
 
86
        For instance, given the following structure:
 
87
 
 
88
                     series               type of relation:
 
89
                       |                    |           |
 
90
            -----------------------         |           o
 
91
            |          |          |         |           |
 
92
            o          o          |      no overlay  overlay
 
93
            |          |          |
 
94
        parent1    parent2    parent3
 
95
 
 
96
        The result would be:
 
97
        [dsp(series, parent1), dsp(series, parent2)]
 
98
        """