On Sep 04, 2009, at 01:15 PM, Julian Edwards wrote:
>= Summary =
>3.0 mechanical changes to sourcepackage builds lists
Awesome, thanks for working on these. 3.0 is really shaping up nicely!
>
>== Implementation details ==
>* SourcePackageView no longer inherits from BuildRecords view
>* New view SourcePackageBuildsView for the converted page so that it better
>encapsulates the build-related stuff, and has a separate page title.
I'm finding that refactoring our view classes really helps out. I think the
new header rules will encourage more of that. Ultimately I think it's better
to use mixins and subclasses more and stop overloading our view classes with
tons of functionality.
>* Very trivial template change!
>
>As a bonus, I fixed the headings on the distroseriesbinarypackage-index.pt
>that I committed a couple of hours ago, the h1 and h2 were the wrong way
>around (and nobody spotted it!).
I took a look at this latter page. Once my branch lp:~barry/launchpad/417089-headings is reviewed and landed, I have some
suggestions for making this page conform to our really-it's-final-this-time
header and title rules. The changes should be simple enough that you can
update the +builds page too, and as I mentioned in IRC, I will give you an
rs=me for a follow up branch to fix this. We may want to give a blanket rs
for any other branches that fix pages to the new rules.
We noticed a few things. First, the def label() should not be necessary.
I'll update my branch so that the base-layout falls back to view.context.title
when view.label is not defined. Second, by default base-layout cgi.escapes
the label, but it should also smartquote it. Third, I think you can basically
get rid of DistroSeriesBinaryPackageView. Once my branch lands, there'll be
no reason not to just use LaunchpadView. Removing code rocks!
rs=me for all those follow up changes (though of course, I'm happy to review
the branch if you want).
In the meantime, I have only a minor suggestion for something to fix as your
branch stands now, so r=me with its consideration. The branch looks great,
thanks.
review approve
status approve
>or
>https://dogfood.launchpad.net/ubuntu/hardy/+package/kmail
>
>= Launchpad lint =
>
>Checking for conflicts. and issues in doctests and templates.
>Running jslint, xmllint, pyflakes, and pylint.
>Using normal rules.
>
>Linting changed files:
> lib/lp/registry/browser/sourcepackage.py
> lib/lp/soyuz/templates/sourcepackage-builds.pt
> lib/lp/soyuz/browser/sourcepackagebuilds.py
> lib/lp/soyuz/templates/distroseriesbinarypackage-index.pt
> lib/lp/soyuz/browser/configure.zcml
>
=== added file 'lib/lp/soyuz/browser/sourcepackagebuilds.py'
--- lib/lp/soyuz/browser/sourcepackagebuilds.py 1970-01-01 00:00:00 +0000
+++ lib/lp/soyuz/browser/sourcepackagebuilds.py 2009-09-04 12:22:22 +0000
> @@ -0,0 +1,37 @@
> +# Copyright 2009 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +"""Browser views for source package builds."""
> +
> +__metaclass__ = type
> +
> +__all__ = [
> + 'SourcePackageBuildsView',
> + ]
> +
> +from lp.soyuz.browser.build import BuildRecordsView
> +from canonical.lazr.utils import smartquote
> +
> +
> +class SourcePackageBuildsView(BuildRecordsView):
> + """A view for (distro series) source package builds."""
> +
> + @property
> + def page_title(self):
> + return smartquote("Builds for " + self.context.title)
This will likely change too once my branch lands, but I didn't try to convert
this view/page/template to the new header stuff. The rs=me above applies to
this as well.
> +
> + @property
> + def search_name(self):
> + """Direct the builds-list template to omit the name search field."""
> + return False
> +
> + @property
> + def default_build_state(self):
> + """Default build state for sourcepackage builds.
> +
> + This overrides the default that is set on BuildRecordsView."""
Close quote on the next line.
> + # None maps to "all states". The reason we display all states on
> + # this page is because it's unlikely that there will be so
> + # many builds that the listing will be overwhelming.
> + return None
> +
On Sep 04, 2009, at 01:15 PM, Julian Edwards wrote:
>= Summary =
>3.0 mechanical changes to sourcepackage builds lists
Awesome, thanks for working on these. 3.0 is really shaping up nicely!
> ildsView for the converted page so that it better
>== Implementation details ==
>* SourcePackageView no longer inherits from BuildRecords view
>* New view SourcePackageBu
>encapsulates the build-related stuff, and has a separate page title.
I'm finding that refactoring our view classes really helps out. I think the
new header rules will encourage more of that. Ultimately I think it's better
to use mixins and subclasses more and stop overloading our view classes with
tons of functionality.
>* Very trivial template change! arypackage- index.pt
>
>As a bonus, I fixed the headings on the distroseriesbin
>that I committed a couple of hours ago, the h1 and h2 were the wrong way
>around (and nobody spotted it!).
We'll see about this one. :)
> /launchpad. dev/ubuntu/ warty/+ source/ mozilla- firefox/ +builds /launchpad. dev/ubuntu/ warty/+ package/ mozilla- firefox/
>== Tests ==
>bin/test -cvvt xx-builds-pages
>
>== Demo and Q/A ==
>For the builds change:
>https:/
>
>For the h1/h2 swap:
>https:/
I took a look at this latter page. Once my branch it's-final- this-time
lp:~barry/launchpad/417089-headings is reviewed and landed, I have some
suggestions for making this page conform to our really-
header and title rules. The changes should be simple enough that you can
update the +builds page too, and as I mentioned in IRC, I will give you an
rs=me for a follow up branch to fix this. We may want to give a blanket rs
for any other branches that fix pages to the new rules.
Here's the diff of the changes I had to make.
=== modified file 'lib/lp/ soyuz/browser/ distroseriesbin arypackage. py' soyuz/browser/ distroseriesbin arypackage. py 2009-09-03 16:38:19 +0000 soyuz/browser/ distroseriesbin arypackage. py 2009-09-04 15:44:12 +0000
self. context = context
self. request = request
--- lib/lp/
+++ lib/lp/
@@ -51,6 +51,5 @@
- @property self.context. title)
- def page_title(self):
- return smartquote(
+ def label(self):
+ return self.context.title
=== modified file 'lib/lp/ soyuz/templates /distroseriesbi narypackage- index.pt' soyuz/templates /distroseriesbi narypackage- index.pt 2009-09-04 12:43:13 +0000 soyuz/templates /distroseriesbi narypackage- index.pt 2009-09-04 15:32:31 +0000
--- lib/lp/
+++ lib/lp/
@@ -8,14 +8,8 @@
>
<body> "heading" > "view/page_ title"/ > slot="main" >
- <metal:heading fill-slot=
- <h2 tal:content=
- </metal:heading>
-
<div metal:fill-
- <h1 tal:content= "context/ summary" /> description/ fmt:text- to-html" > description>
-
<tal:description replace="structure context/
Package Description
</tal:
We noticed a few things. First, the def label() should not be necessary. aryPackageView. Once my branch lands, there'll be
I'll update my branch so that the base-layout falls back to view.context.title
when view.label is not defined. Second, by default base-layout cgi.escapes
the label, but it should also smartquote it. Third, I think you can basically
get rid of DistroSeriesBin
no reason not to just use LaunchpadView. Removing code rocks!
rs=me for all those follow up changes (though of course, I'm happy to review
the branch if you want).
In the meantime, I have only a minor suggestion for something to fix as your
branch stands now, so r=me with its consideration. The branch looks great,
thanks.
review approve
status approve
>or /dogfood. launchpad. net/ubuntu/ hardy/+ package/ kmail registry/ browser/ sourcepackage. py soyuz/templates /sourcepackage- builds. pt soyuz/browser/ sourcepackagebu ilds.py soyuz/templates /distroseriesbi narypackage- index.pt soyuz/browser/ configure. zcml
>https:/
>
>= Launchpad lint =
>
>Checking for conflicts. and issues in doctests and templates.
>Running jslint, xmllint, pyflakes, and pylint.
>Using normal rules.
>
>Linting changed files:
> lib/lp/
> lib/lp/
> lib/lp/
> lib/lp/
> lib/lp/
>
=== added file 'lib/lp/ soyuz/browser/ sourcepackagebu ilds.py' soyuz/browser/ sourcepackagebu ilds.py 1970-01-01 00:00:00 +0000 soyuz/browser/ sourcepackagebu ilds.py 2009-09-04 12:22:22 +0000 uildsView' , browser. build import BuildRecordsView lazr.utils import smartquote ildsView( BuildRecordsVie w):
--- lib/lp/
+++ lib/lp/
> @@ -0,0 +1,37 @@
> +# Copyright 2009 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
> +
> +"""Browser views for source package builds."""
> +
> +__metaclass__ = type
> +
> +__all__ = [
> + 'SourcePackageB
> + ]
> +
> +from lp.soyuz.
> +from canonical.
> +
> +
> +class SourcePackageBu
> + """A view for (distro series) source package builds."""
> +
> + @property
> + def page_title(self):
> + return smartquote("Builds for " + self.context.title)
This will likely change too once my branch lands, but I didn't try to convert
this view/page/template to the new header stuff. The rs=me above applies to
this as well.
> + build_state( self): w."""
> + @property
> + def search_name(self):
> + """Direct the builds-list template to omit the name search field."""
> + return False
> +
> + @property
> + def default_
> + """Default build state for sourcepackage builds.
> +
> + This overrides the default that is set on BuildRecordsVie
Close quote on the next line.
> + # None maps to "all states". The reason we display all states on
> + # this page is because it's unlikely that there will be so
> + # many builds that the listing will be overwhelming.
> + return None
> +
=== modified file 'lib/lp/ soyuz/templates /distroseriesbi narypackage- index.pt' soyuz/templates /distroseriesbi narypackage- index.pt 2009-09-03 16:38:19 +0000 soyuz/templates /distroseriesbi narypackage- index.pt 2009-09-04 12:43:13 +0000 "heading" > "view/page_ title"/ > "view/page_ title"/ > slot="main" > "context/ summary" /> "context/ summary" />
--- lib/lp/
+++ lib/lp/
> @@ -9,12 +9,12 @@
>
> <body>
> <metal:heading fill-slot=
> - <h1 tal:content=
> + <h2 tal:content=
> </metal:heading>
>
> <div metal:fill-
>
> - <h2 tal:content=
> + <h1 tal:content=
See above.
> description/ fmt:text- to-html" >
> <tal:description replace="structure context/
> Package Description
=== modified file 'lib/lp/ soyuz/templates /sourcepackage- builds. pt' soyuz/templates /sourcepackage- builds. pt 2009-07-17 17:59:07 +0000 soyuz/templates /sourcepackage- builds. pt 2009-09-04 12:06:54 +0000 xml.zope. org/namespaces/ tal" xml.zope. org/namespaces/ metal" xml.zope. org/namespaces/ i18n" macro=" context/ @@main_ template/ master" macro=" view/macro: page/main_ only" "launchpad" leftportlets fill-slot= "portlets_ one"> "structure context/ @@+portlet- upstream" /> leftportlets> rightportlets fill-slot= "portlets_ two"> "structure context/ @@+portlet- releases" /> rightportlets> slot="main" > "context/ title"/ > builds</h1> "view/page_ title"/ >
--- lib/lp/
+++ lib/lp/
> @@ -3,26 +3,15 @@
> xmlns:tal="http://
> xmlns:metal="http://
> xmlns:i18n="http://
> - xml:lang="en"
> - lang="en"
> - dir="ltr"
> - metal:use-
> + metal:use-
> i18n:domain=
> >
>
> <body>
>
> -<metal:
> - <div tal:replace=
> -</metal:
> -
> -<metal:
> - <div tal:replace=
> -</metal:
> -
> <div metal:fill-
>
> - <h1><span tal:replace=
> + <h1 tal:content=
See above.
> "structure context/ @@+builds- list"/>
> <div tal:replace=
> </div>