~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/browser/sourcepackage.py

  • Committer: Curtis Hovey
  • Date: 2011-05-27 21:53:34 UTC
  • mto: This revision was merged to the branch mainline in revision 13136.
  • Revision ID: curtis.hovey@canonical.com-20110527215334-jqlkmt52nnl4bpeh
Moved launchpad.event into registry interfaces.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
    'SourcePackageCopyrightView',
11
11
    ]
12
12
 
13
 
from zope.component import getUtility
14
 
 
15
 
from canonical.launchpad.webapp import (
16
 
    LaunchpadView,
17
 
    Navigation,
18
 
    )
19
13
from canonical.lazr.utils import smartquote
20
 
from lp.registry.interfaces.distribution import IDistributionSet
21
 
from lp.registry.interfaces.distroseries import IDistroSeriesSet
22
 
from lp.registry.interfaces.distroseriesdifference import (
23
 
    IDistroSeriesDifferenceSource,
24
 
    )
25
 
 
26
 
 
27
 
class SourcePackageChangelogView(LaunchpadView):
 
14
 
 
15
 
 
16
class SourcePackageChangelogView:
28
17
    """View class for source package change logs."""
29
18
 
30
19
    page_title = "Change log"
35
24
        return smartquote("Change logs for " + self.context.title)
36
25
 
37
26
 
38
 
class SourcePackageCopyrightView(LaunchpadView):
 
27
class SourcePackageCopyrightView:
39
28
    """A view to display a source package's copyright information."""
40
29
 
41
30
    page_title = "Copyright"
44
33
    def label(self):
45
34
        """Page heading."""
46
35
        return smartquote("Copyright for " + self.context.title)
47
 
 
48
 
 
49
 
class SourcePackageDifferenceView(Navigation):
50
 
    """A view to traverse to a DistroSeriesDifference.
51
 
    """
52
 
 
53
 
    def traverse(self, parent_distro_name):
54
 
        parent_distro = getUtility(
55
 
            IDistributionSet).getByName(parent_distro_name)
56
 
        parent_series = getUtility(
57
 
            IDistroSeriesSet).queryByName(
58
 
                parent_distro, self.request.stepstogo.consume())
59
 
        dsd_source = getUtility(IDistroSeriesDifferenceSource)
60
 
        return dsd_source.getByDistroSeriesNameAndParentSeries(
61
 
            self.context.distroseries, self.context.name, parent_series)