~launchpad-pqm/launchpad/devel

8687.15.17 by Karl Fogel
Add the copyright header block to the rest of the files under lib/lp/.
1
# Copyright 2009 Canonical Ltd.  This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
2705 by Canonical.com Patch Queue Manager
r=spiv, mark's soyuz loving.
3
4
__metaclass__ = type
5
6
__all__ = [
9310.1.3 by Julian Edwards
Add distroarchseriesbinarypackagerelease breadcrumbs.
7
    'DistroArchSeriesBinaryPackageReleaseBreadcrumb',
4285.2.1 by Mark Shuttleworth
Massive renaming of distrorelease to distroseries
8
    'DistroArchSeriesBinaryPackageReleaseNavigation',
9
    'DistroArchSeriesBinaryPackageReleaseView',
2705 by Canonical.com Patch Queue Manager
r=spiv, mark's soyuz loving.
10
    ]
11
14433.2.43 by Curtis Hovey
Removed unused page title.
12
from lazr.restful.utils import smartquote
13
11403.1.4 by Henning Eggers
Reformatted imports using format-imports script r32.
14
from canonical.launchpad.webapp import (
15
    ApplicationMenu,
13303.11.10 by Aaron Bentley
Fix pages broken by assuming LaunchpadView.
16
    LaunchpadView,
11403.1.4 by Henning Eggers
Reformatted imports using format-imports script r32.
17
    Navigation,
18
    )
19
from canonical.launchpad.webapp.breadcrumb import Breadcrumb
8294.6.1 by Julian Edwards
First stab at code-reorg. Still got a discrepancy on stuff I assigned to registry but not migrated yet.
20
from lp.soyuz.interfaces.distroarchseriesbinarypackagerelease import (
11403.1.4 by Henning Eggers
Reformatted imports using format-imports script r32.
21
    IDistroArchSeriesBinaryPackageRelease,
22
    )
9310.1.3 by Julian Edwards
Add distroarchseriesbinarypackagerelease breadcrumbs.
23
24
25
class DistroArchSeriesBinaryPackageReleaseBreadcrumb(Breadcrumb):
26
    """A breadcrumb for `DistroArchSeriesBinaryPackageRelease`."""
27
28
    @property
29
    def text(self):
30
        return self.context.version
2705 by Canonical.com Patch Queue Manager
r=spiv, mark's soyuz loving.
31
32
4285.2.1 by Mark Shuttleworth
Massive renaming of distrorelease to distroseries
33
class DistroArchSeriesBinaryPackageReleaseOverviewMenu(ApplicationMenu):
2705 by Canonical.com Patch Queue Manager
r=spiv, mark's soyuz loving.
34
4285.2.1 by Mark Shuttleworth
Massive renaming of distrorelease to distroseries
35
    usedfor = IDistroArchSeriesBinaryPackageRelease
2705 by Canonical.com Patch Queue Manager
r=spiv, mark's soyuz loving.
36
    facet = 'overview'
37
    links = []
38
39
4285.2.1 by Mark Shuttleworth
Massive renaming of distrorelease to distroseries
40
class DistroArchSeriesBinaryPackageReleaseNavigation(Navigation):
41
    usedfor = IDistroArchSeriesBinaryPackageRelease
2705 by Canonical.com Patch Queue Manager
r=spiv, mark's soyuz loving.
42
43
13303.11.10 by Aaron Bentley
Fix pages broken by assuming LaunchpadView.
44
class DistroArchSeriesBinaryPackageReleaseView(LaunchpadView):
2705 by Canonical.com Patch Queue Manager
r=spiv, mark's soyuz loving.
45
46
    def __init__(self, context, request):
47
        self.context = context
48
        self.request = request
14433.2.43 by Curtis Hovey
Removed unused page title.
49
50
    @property
51
    def page_title(self):
52
        return smartquote(self.context.title)