~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/distributionsourcepackage.py

  • Committer: Colin Watson
  • Date: 2011-08-19 00:25:11 UTC
  • mfrom: (7675.1045.728 db-devel)
  • mto: This revision was merged to the branch mainline in revision 13909.
  • Revision ID: cjwatson@canonical.com-20110819002511-0x8hrqs1ckiqk53g
merge db-devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
__metaclass__ = type
5
5
 
6
6
__all__ = [
7
 
    'distribution_from_distributionsourcepackage',
8
7
    'DistributionSourcePackageAnswersMenu',
9
8
    'DistributionSourcePackageBreadcrumb',
10
9
    'DistributionSourcePackageChangelogView',
22
21
import operator
23
22
 
24
23
from lazr.delegates import delegates
 
24
from lazr.restful.interfaces import IJSONRequestCache
25
25
import pytz
26
26
from zope.component import (
27
27
    adapter,
28
28
    getUtility,
29
29
    )
30
30
from zope.interface import (
31
 
    implementer,
32
31
    implements,
33
32
    Interface,
34
33
    )
116
115
            self.context.sourcepackagename.name)
117
116
 
118
117
 
119
 
@adapter(IDistributionSourcePackage)
120
 
@implementer(IServiceUsage)
121
 
def distribution_from_distributionsourcepackage(dsp):
122
 
    return dsp.distribution
123
 
 
124
 
 
125
118
class DistributionSourcePackageFacets(QuestionTargetFacetMixin,
126
119
                                      StandardLaunchpadFacets):
127
120
 
130
123
 
131
124
    def overview(self):
132
125
        text = 'Overview'
133
 
        summary = 'General information about {0}'.format(self.context.displayname)
 
126
        summary = 'General information about {0}'.format(
 
127
            self.context.displayname)
134
128
        return Link('', text, summary)
135
129
 
136
130
    def bugs(self):
277
271
        return Link('+changelog', text, icon="info")
278
272
 
279
273
 
280
 
class DistributionSourcePackageBaseView:
 
274
class DistributionSourcePackageBaseView(LaunchpadView):
281
275
    """Common features to all `DistributionSourcePackage` views."""
282
276
 
283
277
    def releases(self):
344
338
        expose_structural_subscription_data_to_js(
345
339
            self.context, self.request, self.user)
346
340
 
 
341
        pub = self.context.latest_overall_publication
 
342
        if pub:
 
343
            IJSONRequestCache(self.request).objects['archive_context_url'] = (
 
344
                canonical_url(pub.archive, path_only_if_possible=True))
 
345
 
347
346
    @property
348
347
    def label(self):
349
348
        return self.context.title
633
632
    cancel_url = next_url
634
633
 
635
634
 
636
 
class DistributionSourcePackageHelpView:
 
635
class DistributionSourcePackageHelpView(LaunchpadView):
637
636
    """A View to show Answers help."""
638
637
 
639
638
    page_title = 'Help and support options'