Merge lp:~edwin-grubbs/launchpad/bug-272343-packaging-views into lp:launchpad
- bug-272343-packaging-views
- Merge into devel
Status: | Merged |
---|---|
Approved by: | Curtis Hovey |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~edwin-grubbs/launchpad/bug-272343-packaging-views |
Merge into: | lp:launchpad |
Diff against target: |
552 lines (+104/-215) 7 files modified
lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt (+0/-1) lib/canonical/launchpad/webapp/menu.py (+6/-1) lib/lp/registry/browser/configure.zcml (+0/-7) lib/lp/registry/browser/packaging.py (+1/-76) lib/lp/registry/browser/productseries.py (+61/-15) lib/lp/registry/browser/tests/packaging-views.txt (+36/-72) lib/lp/registry/templates/productseries-packaging.pt (+0/-43) |
To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-272343-packaging-views |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Curtis Hovey (community) | Approve | ||
Review via email: mp+17859@code.launchpad.net |
Commit message
Description of the change
Edwin Grubbs (edwin-grubbs) wrote : | # |
Curtis Hovey (sinzui) wrote : | # |
Hi Edwin.
I really appreciate your refactoring to remove the obsolete view. There is a conflict with DistroSeriesStatus that you need to fix. Adi renamed it SeriesStatus yesterday.
I have some hesitation about the assert in the doctest. There was a bad test in the past that wrote the assert wrongly and we did not discover it until after users reported errors. There is nothing wrong with your use, but printing the expected items would make it clear what you expected to be in the vocabulary tokens.
Edwin Grubbs (edwin-grubbs) wrote : | # |
> Hi Edwin.
>
> I really appreciate your refactoring to remove the obsolete view. There is a
> conflict with DistroSeriesStatus that you need to fix. Adi renamed it
> SeriesStatus yesterday.
>
> I have some hesitation about the assert in the doctest. There was a bad test
> in the past that wrote the assert wrongly and we did not discover it until
> after users reported errors. There is nothing wrong with your use, but
> printing the expected items would make it clear what you expected to be in the
> vocabulary tokens.
Hi Curtis,
Thanks for the review. Here is the incremental diff:
{{{
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -27,8 +27,9 @@
[]
>>> transaction.
-The view has a label and requires a distro series, source package name,
-and a packaging contents.
+The view has a label and requires a distro series and a source package name.
+The distroseries field's vocabulary is the same as the ubuntu.series
+attribute.
>>> view = create_
>>> print view.label
@@ -43,13 +44,19 @@
>>> print view.cancel_url
http://
- >>> series_names = [series.name for series in ubuntu.series]
+ >>> for series in ubuntu.series:
+ ... print series.name
+ breezy-autotest
+ grumpy
+ hoary
+ warty
>>> view.setUpFields()
- >>> vocabulary_tokens = [
- ... term.token
- ... for term in view.form_
- ... ]
- >>> assert vocabulary_tokens == series_names
+ >>> for term in view.form_
+ ... print term.token
+ breezy-autotest
+ grumpy
+ hoary
+ warty
>>> form = {
... 'field.
}}}
Curtis Hovey (sinzui) wrote : | # |
On Fri, 2010-01-22 at 16:53 +0000, Edwin Grubbs wrote:
> > Hi Edwin.
> >
> > I really appreciate your refactoring to remove the obsolete view. There is a
> > conflict with DistroSeriesStatus that you need to fix. Adi renamed it
> > SeriesStatus yesterday.
> >
> > I have some hesitation about the assert in the doctest. There was a bad test
> > in the past that wrote the assert wrongly and we did not discover it until
> > after users reported errors. There is nothing wrong with your use, but
> > printing the expected items would make it clear what you expected to be in the
> > vocabulary tokens.
>
> Hi Curtis,
>
> Thanks for the review. Here is the incremental diff:
These change look good. thank you.
--
__Curtis C. Hovey_________
http://
Preview Diff
1 | === modified file 'lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt' |
2 | --- lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt 2009-12-05 13:36:12 +0000 |
3 | +++ lib/canonical/launchpad/pagetests/basics/notfound-traversals.txt 2010-01-22 22:32:18 +0000 |
4 | @@ -114,7 +114,6 @@ |
5 | >>> check("/firefox") |
6 | >>> check("/firefox/+series") |
7 | >>> check("/firefox/1.0") |
8 | ->>> check("/firefox/1.0/+addpackage", auth=True) |
9 | >>> check("/firefox/1.0/+ubuntupkg", auth=True) |
10 | >>> check("/firefox/1.0/+edit", auth=True) |
11 | >>> check("/firefox/1.0/+specs") |
12 | |
13 | === modified file 'lib/canonical/launchpad/webapp/menu.py' |
14 | --- lib/canonical/launchpad/webapp/menu.py 2009-08-13 00:51:50 +0000 |
15 | +++ lib/canonical/launchpad/webapp/menu.py 2010-01-22 22:32:18 +0000 |
16 | @@ -229,7 +229,12 @@ |
17 | pass |
18 | |
19 | def _buildLink(self, name): |
20 | - method = getattr(self, name) |
21 | + method = getattr(self, name, None) |
22 | + # Since Zope traversals hides the root cause of an AttributeError, |
23 | + # an AssertionError is raised explaining what went wrong. |
24 | + if method is None: |
25 | + raise AssertionError( |
26 | + '%r does not define %r method.' % (self, name)) |
27 | linkdata = method() |
28 | # The link need only provide ILinkData. We need an ILink so that |
29 | # we can set attributes on it like 'name' and 'url' and 'linked'. |
30 | |
31 | === modified file 'lib/lp/registry/browser/configure.zcml' |
32 | --- lib/lp/registry/browser/configure.zcml 2010-01-06 13:42:17 +0000 |
33 | +++ lib/lp/registry/browser/configure.zcml 2010-01-22 22:32:18 +0000 |
34 | @@ -1594,13 +1594,6 @@ |
35 | template="../templates/productseries-table-releases.pt"/> |
36 | </browser:pages> |
37 | <browser:page |
38 | - name="+addpackage" |
39 | - for="lp.registry.interfaces.productseries.IProductSeries" |
40 | - class="lp.registry.browser.packaging.PackagingAddView" |
41 | - facet="overview" |
42 | - permission="launchpad.View" |
43 | - template="../templates/productseries-packaging.pt"/> |
44 | - <browser:page |
45 | name="+ubuntupkg" |
46 | facet="overview" |
47 | template="../templates/productseries-ubuntupkg.pt" |
48 | |
49 | === modified file 'lib/lp/registry/browser/packaging.py' |
50 | --- lib/lp/registry/browser/packaging.py 2010-01-11 16:26:52 +0000 |
51 | +++ lib/lp/registry/browser/packaging.py 2010-01-22 22:32:18 +0000 |
52 | @@ -4,7 +4,6 @@ |
53 | __metaclass__ = type |
54 | |
55 | __all__ = [ |
56 | - 'PackagingAddView', |
57 | 'PackagingDeleteView', |
58 | ] |
59 | |
60 | @@ -14,82 +13,8 @@ |
61 | from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary |
62 | |
63 | from canonical.launchpad import _ |
64 | -from lp.registry.interfaces.packaging import ( |
65 | - IPackaging, IPackagingUtil) |
66 | -from canonical.launchpad.webapp import canonical_url |
67 | +from lp.registry.interfaces.packaging import IPackagingUtil |
68 | from canonical.launchpad.webapp.launchpadform import action, LaunchpadFormView |
69 | -from canonical.launchpad.webapp.menu import structured |
70 | - |
71 | - |
72 | -class PackagingAddView(LaunchpadFormView): |
73 | - schema = IPackaging |
74 | - field_names = ['distroseries', 'sourcepackagename', 'packaging'] |
75 | - default_distroseries = None |
76 | - |
77 | - @property |
78 | - def label(self): |
79 | - """See `LaunchpadFormView`.""" |
80 | - return 'Packaging of %s in distributions' % self.context.displayname |
81 | - |
82 | - page_title = label |
83 | - |
84 | - @property |
85 | - def next_url(self): |
86 | - """See `LaunchpadFormView`.""" |
87 | - return canonical_url(self.context) |
88 | - |
89 | - cancel_url = next_url |
90 | - |
91 | - def validate(self, data): |
92 | - productseries = self.context |
93 | - sourcepackagename = data.get('sourcepackagename', None) |
94 | - distroseries = data.get('distroseries', self.default_distroseries) |
95 | - if sourcepackagename is None: |
96 | - message = "You must choose the source package name." |
97 | - self.setFieldError('sourcepackagename', message) |
98 | - # Do not allow users it create links to unpublished Ubuntu packages. |
99 | - elif distroseries.distribution.full_functionality: |
100 | - source_package = distroseries.getSourcePackage(sourcepackagename) |
101 | - if source_package.currentrelease is None: |
102 | - message = ("The source package is not published in %s." % |
103 | - distroseries.displayname) |
104 | - self.setFieldError('sourcepackagename', message) |
105 | - else: |
106 | - pass |
107 | - packaging_util = getUtility(IPackagingUtil) |
108 | - if packaging_util.packagingEntryExists( |
109 | - productseries=productseries, |
110 | - sourcepackagename=sourcepackagename, |
111 | - distroseries=distroseries): |
112 | - # The series packaging conflicts with itself. |
113 | - message = _( |
114 | - "This series is already packaged in %s." % |
115 | - distroseries.displayname) |
116 | - self.setFieldError('sourcepackagename', message) |
117 | - elif packaging_util.packagingEntryExists( |
118 | - sourcepackagename=sourcepackagename, |
119 | - distroseries=distroseries): |
120 | - # The series package conflicts with another series. |
121 | - sourcepackage = distroseries.getSourcePackage( |
122 | - sourcepackagename.name) |
123 | - message = structured( |
124 | - 'The <a href="%s">%s</a> package in %s is already linked to ' |
125 | - 'another series.' % |
126 | - (canonical_url(sourcepackage), |
127 | - sourcepackagename.name, |
128 | - distroseries.displayname)) |
129 | - self.setFieldError('sourcepackagename', message) |
130 | - else: |
131 | - # The distroseries and sourcepackagename are not already linked |
132 | - # to this series, or any other series. |
133 | - pass |
134 | - |
135 | - @action('Continue', name='continue') |
136 | - def continue_action(self, action, data): |
137 | - productseries = self.context |
138 | - getUtility(IPackagingUtil).createPackaging( |
139 | - productseries, data['sourcepackagename'], data['distroseries'], |
140 | - data['packaging'], owner=self.user) |
141 | |
142 | |
143 | class PackagingDeleteView(LaunchpadFormView): |
144 | |
145 | === modified file 'lib/lp/registry/browser/productseries.py' |
146 | --- lib/lp/registry/browser/productseries.py 2010-01-20 15:41:25 +0000 |
147 | +++ lib/lp/registry/browser/productseries.py 2010-01-22 22:32:18 +0000 |
148 | @@ -59,25 +59,27 @@ |
149 | from lp.registry.browser.structuralsubscription import ( |
150 | StructuralSubscriptionMenuMixin, |
151 | StructuralSubscriptionTargetTraversalMixin) |
152 | +from lp.registry.interfaces.packaging import ( |
153 | + IPackaging, IPackagingUtil) |
154 | from lp.translations.interfaces.potemplate import IPOTemplateSet |
155 | from lp.translations.interfaces.productserieslanguage import ( |
156 | IProductSeriesLanguageSet) |
157 | from lp.services.worlddata.interfaces.language import ILanguageSet |
158 | from canonical.launchpad.webapp import ( |
159 | - action, ApplicationMenu, canonical_url, custom_widget, |
160 | - enabled_with_permission, LaunchpadEditFormView, |
161 | - LaunchpadView, Link, Navigation, NavigationMenu, StandardLaunchpadFacets, |
162 | - stepthrough, stepto) |
163 | + ApplicationMenu, canonical_url, enabled_with_permission, LaunchpadView, |
164 | + Link, Navigation, NavigationMenu, StandardLaunchpadFacets, stepthrough, |
165 | + stepto) |
166 | from canonical.launchpad.webapp.authorization import check_permission |
167 | from canonical.launchpad.webapp.batching import BatchNavigator |
168 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
169 | from canonical.launchpad.webapp.interfaces import NotFoundError |
170 | +from canonical.launchpad.webapp.launchpadform import ( |
171 | + action, custom_widget, LaunchpadEditFormView, LaunchpadFormView) |
172 | from canonical.launchpad.webapp.menu import structured |
173 | from canonical.widgets.textwidgets import StrippedTextWidget |
174 | |
175 | from lp.registry.browser import ( |
176 | MilestoneOverlayMixin, RegistryDeleteViewMixin) |
177 | -from lp.registry.browser.packaging import PackagingAddView |
178 | from lp.registry.interfaces.series import SeriesStatus |
179 | from lp.registry.interfaces.productseries import IProductSeries |
180 | |
181 | @@ -161,8 +163,7 @@ |
182 | facet = 'overview' |
183 | links = [ |
184 | 'edit', 'delete', 'driver', 'link_branch', 'branch_add', 'ubuntupkg', |
185 | - 'add_package', 'create_milestone', 'create_release', |
186 | - 'rdf', 'subscribe', |
187 | + 'create_milestone', 'create_release', 'rdf', 'subscribe', |
188 | ] |
189 | |
190 | @enabled_with_permission('launchpad.Edit') |
191 | @@ -210,12 +211,6 @@ |
192 | text = 'Link to Ubuntu package' |
193 | return Link('+ubuntupkg', text, icon='add') |
194 | |
195 | - @enabled_with_permission('launchpad.View') |
196 | - def add_package(self): |
197 | - """Return a link to link this series to a sourcepackage.""" |
198 | - text = 'Link package' |
199 | - return Link('+addpackage', text, icon='add') |
200 | - |
201 | @enabled_with_permission('launchpad.Edit') |
202 | def create_milestone(self): |
203 | """Return a link to create a milestone.""" |
204 | @@ -367,8 +362,9 @@ |
205 | return None |
206 | |
207 | |
208 | -class ProductSeriesUbuntuPackagingView(PackagingAddView): |
209 | +class ProductSeriesUbuntuPackagingView(LaunchpadFormView): |
210 | |
211 | + schema = IPackaging |
212 | field_names = ['sourcepackagename', 'distroseries'] |
213 | page_title = 'Ubuntu source packaging' |
214 | label = page_title |
215 | @@ -386,6 +382,13 @@ |
216 | # The package has never been set. |
217 | self.default_sourcepackagename = None |
218 | |
219 | + @property |
220 | + def next_url(self): |
221 | + """See `LaunchpadFormView`.""" |
222 | + return canonical_url(self.context) |
223 | + |
224 | + cancel_url = next_url |
225 | + |
226 | def setUpFields(self): |
227 | """See `LaunchpadFormView`. |
228 | |
229 | @@ -428,11 +431,54 @@ |
230 | self.default_distroseries.distribution) |
231 | |
232 | def validate(self, data): |
233 | + productseries = self.context |
234 | sourcepackagename = data.get('sourcepackagename', None) |
235 | + distroseries = data.get('distroseries', self.default_distroseries) |
236 | + |
237 | if sourcepackagename == self.default_sourcepackagename: |
238 | # The data has not changed, so nothing else needs to be done. |
239 | return |
240 | - super(ProductSeriesUbuntuPackagingView, self).validate(data) |
241 | + |
242 | + if sourcepackagename is None: |
243 | + message = "You must choose the source package name." |
244 | + self.setFieldError('sourcepackagename', message) |
245 | + # Do not allow users it create links to unpublished Ubuntu packages. |
246 | + elif distroseries.distribution.full_functionality: |
247 | + source_package = distroseries.getSourcePackage(sourcepackagename) |
248 | + if source_package.currentrelease is None: |
249 | + message = ("The source package is not published in %s." % |
250 | + distroseries.displayname) |
251 | + self.setFieldError('sourcepackagename', message) |
252 | + else: |
253 | + pass |
254 | + packaging_util = getUtility(IPackagingUtil) |
255 | + if packaging_util.packagingEntryExists( |
256 | + productseries=productseries, |
257 | + sourcepackagename=sourcepackagename, |
258 | + distroseries=distroseries): |
259 | + # The series packaging conflicts with itself. |
260 | + message = _( |
261 | + "This series is already packaged in %s." % |
262 | + distroseries.displayname) |
263 | + self.setFieldError('sourcepackagename', message) |
264 | + elif packaging_util.packagingEntryExists( |
265 | + sourcepackagename=sourcepackagename, |
266 | + distroseries=distroseries): |
267 | + # The series package conflicts with another series. |
268 | + sourcepackage = distroseries.getSourcePackage( |
269 | + sourcepackagename.name) |
270 | + message = structured( |
271 | + 'The <a href="%s">%s</a> package in %s is already linked to ' |
272 | + 'another series.' % |
273 | + (canonical_url(sourcepackage), |
274 | + sourcepackagename.name, |
275 | + distroseries.displayname)) |
276 | + self.setFieldError('sourcepackagename', message) |
277 | + else: |
278 | + # The distroseries and sourcepackagename are not already linked |
279 | + # to this series, or any other series. |
280 | + pass |
281 | + |
282 | |
283 | @action('Update', name='continue') |
284 | def continue_action(self, action, data): |
285 | |
286 | === modified file 'lib/lp/registry/browser/tests/packaging-views.txt' |
287 | --- lib/lp/registry/browser/tests/packaging-views.txt 2010-01-20 15:41:25 +0000 |
288 | +++ lib/lp/registry/browser/tests/packaging-views.txt 2010-01-22 22:32:18 +0000 |
289 | @@ -8,7 +8,7 @@ |
290 | ------------------------------ |
291 | |
292 | Distro series sourcepackages can be linked to product series using the |
293 | -+addpackage named view. |
294 | ++ubuntupkg named view. |
295 | |
296 | >>> from canonical.launchpad.interfaces.launchpad import ( |
297 | ... ILaunchpadCelebrities) |
298 | @@ -25,31 +25,47 @@ |
299 | ... product=product, name='hotter') |
300 | >>> productseries.sourcepackages |
301 | [] |
302 | - |
303 | -The view has a label and requires a distro series, source package name, |
304 | -and a packaging contents. |
305 | - |
306 | - >>> view = create_view(productseries, '+addpackage') |
307 | + >>> transaction.commit() |
308 | + |
309 | +The view has a label and requires a distro series and a source package name. |
310 | +The distroseries field's vocabulary is the same as the ubuntu.series |
311 | +attribute. |
312 | + |
313 | + >>> view = create_view(productseries, '+ubuntupkg') |
314 | >>> print view.label |
315 | - Packaging of hotter in distributions |
316 | + Ubuntu source packaging |
317 | |
318 | >>> print view.page_title |
319 | - Packaging of hotter in distributions |
320 | + Ubuntu source packaging |
321 | |
322 | >>> print view.field_names |
323 | - ['distroseries', 'sourcepackagename', 'packaging'] |
324 | + ['sourcepackagename', 'distroseries'] |
325 | |
326 | >>> print view.cancel_url |
327 | http://launchpad.dev/hot/hotter |
328 | |
329 | + >>> for series in ubuntu.series: |
330 | + ... print series.name |
331 | + breezy-autotest |
332 | + grumpy |
333 | + hoary |
334 | + warty |
335 | + >>> view.setUpFields() |
336 | + >>> for term in view.form_fields['distroseries'].field.vocabulary: |
337 | + ... print term.token |
338 | + breezy-autotest |
339 | + grumpy |
340 | + hoary |
341 | + warty |
342 | + |
343 | >>> form = { |
344 | - ... 'field.distroseries': 'ubuntu/hoary', |
345 | + ... 'field.distroseries': 'hoary', |
346 | ... 'field.sourcepackagename': 'hot', |
347 | ... 'field.packaging': 'Primary Project', |
348 | ... 'field.actions.continue': 'Continue', |
349 | ... } |
350 | >>> view = create_initialized_view( |
351 | - ... productseries, '+addpackage', form=form) |
352 | + ... productseries, '+ubuntupkg', form=form) |
353 | >>> view.errors |
354 | [] |
355 | >>> for package in productseries.sourcepackages: |
356 | @@ -58,33 +74,19 @@ |
357 | |
358 | >>> transaction.commit() |
359 | |
360 | -It is an error to link a series to the same package and distro series twice. |
361 | - |
362 | - >>> form = { |
363 | - ... 'field.distroseries': 'ubuntu/hoary', |
364 | - ... 'field.sourcepackagename': 'hot', |
365 | - ... 'field.packaging': 'Primary Project', |
366 | - ... 'field.actions.continue': 'Continue', |
367 | - ... } |
368 | - >>> view = create_initialized_view( |
369 | - ... productseries, '+addpackage', form=form) |
370 | - >>> for error in view.errors: |
371 | - ... print error |
372 | - This series is already packaged in Hoary. |
373 | - |
374 | Once a distro series sourcepackage is linked to a product series, no other |
375 | product series can link to it. |
376 | |
377 | >>> other_productseries = factory.makeProductSeries( |
378 | ... product=product, name='hotest') |
379 | >>> form = { |
380 | - ... 'field.distroseries': 'ubuntu/hoary', |
381 | + ... 'field.distroseries': 'hoary', |
382 | ... 'field.sourcepackagename': 'hot', |
383 | ... 'field.packaging': 'Primary Project', |
384 | ... 'field.actions.continue': 'Continue', |
385 | ... } |
386 | >>> view = create_initialized_view( |
387 | - ... other_productseries, '+addpackage', form=form) |
388 | + ... other_productseries, '+ubuntupkg', form=form) |
389 | >>> for error in view.errors: |
390 | ... print error |
391 | The <a href=".../hoary/+source/hot">hot</a> package in Hoary is already |
392 | @@ -93,52 +95,42 @@ |
393 | A source package name must be provided. |
394 | |
395 | >>> form = { |
396 | - ... 'field.distroseries': 'ubuntu/hoary', |
397 | + ... 'field.distroseries': 'hoary', |
398 | ... 'field.sourcepackagename': '', |
399 | ... 'field.packaging': 'Primary Project', |
400 | ... 'field.actions.continue': 'Continue', |
401 | ... } |
402 | >>> view = create_initialized_view( |
403 | - ... productseries, '+addpackage', form=form) |
404 | + ... productseries, '+ubuntupkg', form=form) |
405 | >>> for error in view.errors: |
406 | ... print error |
407 | ('sourcepackagename', u'Source Package Name', RequiredMissing()) |
408 | You must choose the source package name. |
409 | |
410 | In the case of full functionality distributions like Ubuntu, the source |
411 | -package must be published in the distro series. |
412 | +package must be published in the distro series. |
413 | |
414 | >>> vapor_spn = factory.makeSourcePackageName('vapor') |
415 | >>> form = { |
416 | - ... 'field.distroseries': 'ubuntu/hoary', |
417 | + ... 'field.distroseries': 'hoary', |
418 | ... 'field.sourcepackagename': 'vapor', |
419 | ... 'field.packaging': 'Primary Project', |
420 | ... 'field.actions.continue': 'Continue', |
421 | ... } |
422 | >>> view = create_initialized_view( |
423 | - ... productseries, '+addpackage', form=form) |
424 | + ... productseries, '+ubuntupkg', form=form) |
425 | >>> for error in view.errors: |
426 | ... print error |
427 | The source package is not published in Hoary. |
428 | |
429 | -The +addpackage view provides the default_distroseries property. It is None |
430 | -by default, but subclasses may change it. |
431 | - |
432 | - >>> print view.default_distroseries |
433 | - None |
434 | - |
435 | |
436 | Productseries linking Ubuntu packages |
437 | ------------------------------------- |
438 | |
439 | -The +ubuntupkg named view is a subclass of the +addpackage named view. It |
440 | -allows the user to update the current linked Ubuntu package. |
441 | - |
442 | - >>> from lp.registry.browser.packaging import PackagingAddView |
443 | +The +ubuntupkg named view allows the user to update the current linked |
444 | +Ubuntu package. |
445 | |
446 | >>> view = create_initialized_view(productseries, '+ubuntupkg') |
447 | - >>> isinstance(view, PackagingAddView) |
448 | - True |
449 | |
450 | >>> print view.label |
451 | Ubuntu source packaging |
452 | @@ -314,34 +306,10 @@ |
453 | sorted by distribution with Ubuntu first and the rest in alphabetic |
454 | order. |
455 | |
456 | - >>> form = { |
457 | - ... 'field.distroseries': 'redhat/7.0', |
458 | - ... 'field.sourcepackagename': 'hot', |
459 | - ... 'field.packaging': 'Primary Project', |
460 | - ... 'field.actions.continue': 'Continue', |
461 | - ... } |
462 | - |
463 | - >>> view = create_initialized_view( |
464 | - ... productseries, '+addpackage', form=form) |
465 | - >>> view.errors |
466 | - [] |
467 | - >>> form = { |
468 | - ... 'field.distroseries': 'debian/sarge', |
469 | - ... 'field.sourcepackagename': 'hot', |
470 | - ... 'field.packaging': 'Primary Project', |
471 | - ... 'field.actions.continue': 'Continue', |
472 | - ... } |
473 | - |
474 | - >>> view = create_initialized_view( |
475 | - ... productseries, '+addpackage', form=form) |
476 | - >>> view.errors |
477 | - [] |
478 | >>> view = create_initialized_view(product, name='+packages') |
479 | >>> for distro_dict in view.distro_packaging: |
480 | ... print distro_dict['distribution'].name |
481 | ubuntu |
482 | - debian |
483 | - redhat |
484 | |
485 | The +packages named view descends from PackagingDeleteView to provide remove |
486 | link actions for the product's linked packages. |
487 | @@ -357,8 +325,6 @@ |
488 | >>> view = create_initialized_view(product, name='+packages') |
489 | >>> for package in view.all_packaging: |
490 | ... print package.distroseries.name, package.productseries.name |
491 | - sarge hotter |
492 | - 7.0 hotter |
493 | grumpy hotter |
494 | hoary hotter |
495 | |
496 | @@ -373,8 +339,6 @@ |
497 | [] |
498 | >>> for package in view.all_packaging: |
499 | ... print package.distroseries.name, package.productseries.name |
500 | - sarge hotter |
501 | - 7.0 hotter |
502 | grumpy hotter |
503 | |
504 | |
505 | |
506 | === removed file 'lib/lp/registry/templates/productseries-packaging.pt' |
507 | --- lib/lp/registry/templates/productseries-packaging.pt 2009-09-12 06:11:08 +0000 |
508 | +++ lib/lp/registry/templates/productseries-packaging.pt 1970-01-01 00:00:00 +0000 |
509 | @@ -1,43 +0,0 @@ |
510 | -<html |
511 | - xmlns="http://www.w3.org/1999/xhtml" |
512 | - xmlns:tal="http://xml.zope.org/namespaces/tal" |
513 | - xmlns:metal="http://xml.zope.org/namespaces/metal" |
514 | - xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
515 | - metal:use-macro="view/macro:page/main_only" |
516 | - i18n:domain="launchpad" |
517 | -> |
518 | - |
519 | -<body> |
520 | - |
521 | -<div metal:fill-slot="main"> |
522 | - |
523 | - <div metal:use-macro="context/@@launchpad_form/form"> |
524 | - |
525 | - <div metal:fill-slot="extra_info" |
526 | - tal:define="sourcepackages context/sourcepackages"> |
527 | - <p> |
528 | - Tell Launchpad about a package of |
529 | - <tal:name replace="context/displayname" /> in a release of any |
530 | - supported distribution. |
531 | - <tal:existing condition="sourcepackages"> |
532 | - This series is packaged in the following places: |
533 | - </tal:existing> |
534 | - </p> |
535 | - |
536 | - <ul class="bulleted" |
537 | - tal:condition="sourcepackages"> |
538 | - <li tal:repeat="package sourcepackages"> |
539 | - <tal:distro replace="package/distroseries/distribution/name" /> |
540 | - <tal:series replace="package/distroseries/name" /> |
541 | - <a tal:content="package/name" |
542 | - tal:attributes="href package/fmt:url">apache</a> |
543 | - </li> |
544 | - </ul> |
545 | - </div> |
546 | - |
547 | - </div> |
548 | - |
549 | -</div> |
550 | - |
551 | -</body> |
552 | -</html> |
Summary
-------
Remove PackagingAddView and productseries- packaging. pt.
Implementation details ------- ------- -
-------
Removed PackagingAddView and moved the next_url, cancel_url, untuPackagingVi ew, lp/registry/ browser/ configure. zcml lp/registry/ browser/ packaging. py lp/registry/ browser/ productseries. py
and validate() code from PackagingAddView to ProductSeriesUb
which used to subclass from it.
lib/
lib/
lib/
Removed file: lp/registry/ templates/ productseries- packaging. pt
lib/
Converted tests for +addpackage to test +ubuntupkg unless the lp/registry/ browser/ tests/packaging -views. txt
test is obsolete.
lib/
Make the error clearer when a menu item's method is removed canonical/ launchpad/ webapp/ menu.py
but is still referenced in the menu.links attribute.
lib/
Tests
-----
./bin/test -vv -t 'packaging- views.txt'
Demo and Q/A
------------
* Open a project series.
* Click on "Link to Ubuntu package".
* There should be no change in behavior.