~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/blueprints/browser/specification.py

  • Committer: Curtis Hovey
  • Date: 2011-08-12 14:39:51 UTC
  • mto: This revision was merged to the branch mainline in revision 13685.
  • Revision ID: curtis.hovey@canonical.com-20110812143951-74vfvrt37gtt4fz2
Sorted imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Specification views."""
72
72
    SimpleVocabulary,
73
73
    )
74
74
 
75
 
from lp import _
 
75
from canonical.config import config
 
76
from canonical.launchpad import _
 
77
from canonical.launchpad.webapp import (
 
78
    canonical_url,
 
79
    LaunchpadView,
 
80
    Navigation,
 
81
    stepthrough,
 
82
    stepto,
 
83
    )
 
84
from canonical.launchpad.webapp.authorization import check_permission
 
85
from canonical.launchpad.webapp.menu import (
 
86
    ContextMenu,
 
87
    enabled_with_permission,
 
88
    Link,
 
89
    NavigationMenu,
 
90
    )
76
91
from lp.app.browser.launchpad import AppFrontPageSearchView
77
92
from lp.app.browser.launchpadform import (
78
93
    action,
108
123
from lp.code.interfaces.branchnamespace import IBranchNamespaceSet
109
124
from lp.registry.interfaces.distribution import IDistribution
110
125
from lp.registry.interfaces.product import IProduct
111
 
from lp.services.config import config
112
126
from lp.services.propertycache import cachedproperty
113
 
from lp.services.webapp import (
114
 
    canonical_url,
115
 
    LaunchpadView,
116
 
    Navigation,
117
 
    stepthrough,
118
 
    stepto,
119
 
    )
120
 
from lp.services.webapp.authorization import check_permission
121
 
from lp.services.webapp.menu import (
122
 
    ContextMenu,
123
 
    enabled_with_permission,
124
 
    Link,
125
 
    NavigationMenu,
126
 
    )
127
127
 
128
128
 
129
129
class INewSpecification(Interface):
200
200
        """Registers a new specification."""
201
201
        self.transform(data)
202
202
        spec = getUtility(ISpecificationSet).new(
203
 
            owner=self.user,
204
 
            name=data.get('name'),
205
 
            title=data.get('title'),
206
 
            specurl=data.get('specurl'),
207
 
            summary=data.get('summary'),
208
 
            product=data.get('product'),
209
 
            drafter=data.get('drafter'),
210
 
            assignee=data.get('assignee'),
211
 
            approver=data.get('approver'),
212
 
            distribution=data.get('distribution'),
213
 
            definition_status=data.get('definition_status'))
 
203
            owner = self.user,
 
204
            name = data.get('name'),
 
205
            title = data.get('title'),
 
206
            specurl = data.get('specurl'),
 
207
            summary = data.get('summary'),
 
208
            product = data.get('product'),
 
209
            drafter = data.get('drafter'),
 
210
            assignee = data.get('assignee'),
 
211
            approver = data.get('approver'),
 
212
            distribution = data.get('distribution'),
 
213
            definition_status = data.get('definition_status'))
214
214
        # Propose the specification as a series goal, if specified.
215
215
        series = data.get('series')
216
216
        if series is not None:
562
562
    def page_title(self):
563
563
        return self.label
564
564
 
565
 
    @property
566
 
    def page_description(self):
567
 
        return self.context.summary
568
 
 
569
565
    def initialize(self):
570
566
        # The review that the user requested on this spec, if any.
571
567
        self.notices = []