Thanks for the branch. It looks good save for a few small items below.
> === modified file 'lib/lp/registry/browser/productseries.py'
> --- lib/lp/registry/browser/productseries.py 2009-12-05 18:37:28 +0000
> +++ lib/lp/registry/browser/productseries.py 2010-01-11 23:10:26 +0000
> @@ -33,6 +33,9 @@
>
> from zope.component import getUtility
> from zope.app.form.browser import TextAreaWidget, TextWidget
> +from zope.formlib import form
> +from zope.schema import Choice
> +from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
>
> from z3c.ptcompat import ViewPageTemplateFile
>
> @@ -366,7 +369,7 @@
>
> class ProductSeriesUbuntuPackagingView(PackagingAddView):
>
> - field_names = ['sourcepackagename']
> + field_names = ['sourcepackagename', 'distroseries']
> page_title = 'Ubuntu source packaging'
> label = page_title
>
> @@ -374,8 +377,8 @@
> """Set the static packaging information for this series."""
> super(ProductSeriesUbuntuPackagingView, self).__init__(
> context, request)
> - ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
> - self._ubuntu_series = ubuntu.currentseries
> + self._ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
> + self._ubuntu_series = self._ubuntu.currentseries
> try:
> package = self.context.getPackage(self._ubuntu_series)
> self.default_sourcepackagename = package.sourcepackagename
> @@ -383,6 +386,28 @@
> # The package has never been set.
> self.default_sourcepackagename = None
>
> + def setUpFields(self):
> + """See `LaunchpadFormView`.
> +
> + The packaging is restricted to ubuntu series and the default value
> + is the current development series.
> + """
> + super(PackagingAddView, self).setUpFields()
As we discussed on IRC the class name is wrong.
> + series_vocabulary = SimpleVocabulary(
> + [SimpleTerm(series, series.name, series.named_version)
> + for series in self._ubuntu.series])
> + choice = Choice(__name__='distroseries',
> + title=_('Series'),
> + default=self._ubuntu_series,
> + vocabulary=series_vocabulary,
> + description=_(
> + "Select the Ubuntu series that this package is published "
> + "in. The current series is most important to the Ubuntu "
> + "community."),
I think "series where this package is published" sounds better. What
do you think?
> === modified file 'lib/lp/registry/browser/tests/packaging-views.txt'
> --- lib/lp/registry/browser/tests/packaging-views.txt 2009-12-10 20:03:11 +0000
> +++ lib/lp/registry/browser/tests/packaging-views.txt 2010-01-11 23:10:26 +0000
> @@ -18,6 +18,8 @@
> >>> sourcepackagename = factory.makeSourcePackageName('hot')
> >>> sourcepackage = factory.makeSourcePackage(
> ... sourcepackagename=sourcepackagename, distroseries=hoary)
> + >>> spph = factory.makeSourcePackagePublishingHistory(
> + ... sourcepackagename=sourcepackagename, distroseries=hoary)
> >>> product = factory.makeProduct(name="hot", displayname='Hot')
> >>> productseries = factory.makeProductSeries(
> ... product=product, name='hotter')
> @@ -103,6 +105,22 @@
> ('sourcepackagename', u'Source Package Name', RequiredMissing())
> You must choose the source package name.
>
> +In the case of full functionality distributions like Ubuntu, the source
> +package must be published in the distro series.
> +
> + >>> vapour_spn = factory.makeSourcePackageName('vapour')
Would you mind en_US'ing this to 'vapor'?
> === modified file 'lib/lp/registry/stories/product/xx-product-package-pages.txt'
> --- lib/lp/registry/stories/product/xx-product-package-pages.txt 2009-11-12 23:24:53 +0000
> +++ lib/lp/registry/stories/product/xx-product-package-pages.txt 2010-01-11 23:10:26 +0000
> @@ -35,14 +35,15 @@
>
> >>> evo_owner.getLink(url='/ubuntu/hoary/+source/evolution') is not None
> True
> - >>> evo_owner.getLink(url='/evolution/trunk/+addpackage') is not None
> - True
> -
> -If you're not the owner or an admin, you still see the packages, but without
> -the link to add packages yourself.
> -
> - >>> browser.open('http://launchpad.dev/evolution/+packages')
> - >>> browser.getLink(url='/evolution/trunk/+addpackage')
> +
> +Any login users can still see the links to create a packaging link.
Hi Curtis,
Thanks for the branch. It looks good save for a few small items below.
> === modified file 'lib/lp/ registry/ browser/ productseries. py' registry/ browser/ productseries. py 2009-12-05 18:37:28 +0000 registry/ browser/ productseries. py 2010-01-11 23:10:26 +0000 form.browser import TextAreaWidget, TextWidget vocabulary import SimpleTerm, SimpleVocabulary eFile untuPackagingVi ew(PackagingAdd View): name'] name', 'distroseries'] riesUbuntuPacka gingView, self).__init__( ILaunchpadCeleb rities) .ubuntu currentseries ILaunchpadCeleb rities) .ubuntu currentseries getPackage( self._ubuntu_ series) sourcepackagena me = package. sourcepackagena me sourcepackagena me = None iew`. AddView, self).setUpFields()
> --- lib/lp/
> +++ lib/lp/
> @@ -33,6 +33,9 @@
>
> from zope.component import getUtility
> from zope.app.
> +from zope.formlib import form
> +from zope.schema import Choice
> +from zope.schema.
>
> from z3c.ptcompat import ViewPageTemplat
>
> @@ -366,7 +369,7 @@
>
> class ProductSeriesUb
>
> - field_names = ['sourcepackage
> + field_names = ['sourcepackage
> page_title = 'Ubuntu source packaging'
> label = page_title
>
> @@ -374,8 +377,8 @@
> """Set the static packaging information for this series."""
> super(ProductSe
> context, request)
> - ubuntu = getUtility(
> - self._ubuntu_series = ubuntu.
> + self._ubuntu = getUtility(
> + self._ubuntu_series = self._ubuntu.
> try:
> package = self.context.
> self.default_
> @@ -383,6 +386,28 @@
> # The package has never been set.
> self.default_
>
> + def setUpFields(self):
> + """See `LaunchpadFormV
> +
> + The packaging is restricted to ubuntu series and the default value
> + is the current development series.
> + """
> + super(Packaging
As we discussed on IRC the class name is wrong.
> + series_vocabulary = SimpleVocabulary( named_version) series] ) __name_ _='distroseries ', self._ubuntu_ series, series_ vocabulary,
> + [SimpleTerm(series, series.name, series.
> + for series in self._ubuntu.
> + choice = Choice(
> + title=_('Series'),
> + default=
> + vocabulary=
> + description=_(
> + "Select the Ubuntu series that this package is published "
> + "in. The current series is most important to the Ubuntu "
> + "community."),
I think "series where this package is published" sounds better. What
do you think?
> + required=True) context= self.render_ context) fields. omit(choice. __name_ _) + field iew`.
> + field = form.Fields(choice, render_
> + self.form_fields = self.form_
> +
> def setUpWidgets(self):
> """See `LaunchpadFormV
>
> === modified file 'lib/lp/ registry/ browser/ tests/packaging -views. txt' registry/ browser/ tests/packaging -views. txt 2009-12-10 20:03:11 +0000 registry/ browser/ tests/packaging -views. txt 2010-01-11 23:10:26 +0000 makeSourcePacka geName( 'hot') makeSourcePacka ge( me=sourcepackag ename, distroseries=hoary) makeSourcePacka gePublishingHis tory( me=sourcepackag ename, distroseries=hoary) makeProduct( name="hot" , displayname='Hot') makeProductSeri es( name', u'Source Package Name', RequiredMissing()) makeSourcePacka geName( 'vapour' )
> --- lib/lp/
> +++ lib/lp/
> @@ -18,6 +18,8 @@
> >>> sourcepackagename = factory.
> >>> sourcepackage = factory.
> ... sourcepackagena
> + >>> spph = factory.
> + ... sourcepackagena
> >>> product = factory.
> >>> productseries = factory.
> ... product=product, name='hotter')
> @@ -103,6 +105,22 @@
> ('sourcepackage
> You must choose the source package name.
>
> +In the case of full functionality distributions like Ubuntu, the source
> +package must be published in the distro series.
> +
> + >>> vapour_spn = factory.
Would you mind en_US'ing this to 'vapor'?
> === modified file 'lib/lp/ registry/ stories/ product/ xx-product- package- pages.txt' registry/ stories/ product/ xx-product- package- pages.txt 2009-11-12 23:24:53 +0000 registry/ stories/ product/ xx-product- package- pages.txt 2010-01-11 23:10:26 +0000 getLink( url='/ubuntu/ hoary/+ source/ evolution' ) is not None getLink( url='/evolution /trunk/ +addpackage' ) is not None launchpad. dev/evolution/ +packages') getLink( url='/evolution /trunk/ +addpackage' )
> --- lib/lp/
> +++ lib/lp/
> @@ -35,14 +35,15 @@
>
> >>> evo_owner.
> True
> - >>> evo_owner.
> - True
> -
> -If you're not the owner or an admin, you still see the packages, but without
> -the link to add packages yourself.
> -
> - >>> browser.open('http://
> - >>> browser.
> +
> +Any login users can still see the links to create a packaging link.
s/login/logged in/
> + >>> user_browser.open('http:// launchpad. dev/evolution/ +packages') getLink( url='/evolution /trunk/ +ubuntupkg' ).url launchpad. dev/evolution/ trunk/+ ubuntupkg launchpad. dev/evolution/ +packages') getLink( url='/evolution /trunk/ +ubuntupkg' )
> + >>> print user_browser.
> + http://
> +
> + >>> anon_browser.open('http://
> + >>> anon_browser.
> Traceback (most recent call last):
> ...
> LinkNotFoundError