Merge lp:~lifeless/launchpad/malone into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Robert Collins on 2010-09-19 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 11582 | ||||
| Proposed branch: | lp:~lifeless/launchpad/malone | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
598 lines (+223/-101) 13 files modified
lib/canonical/launchpad/webapp/batching.py (+18/-0) lib/lp/blueprints/browser/tests/test_specificationtarget.py (+6/-27) lib/lp/bugs/browser/bugtracker.py (+29/-16) lib/lp/bugs/browser/tests/test_bugtracker_views.py (+51/-17) lib/lp/bugs/interfaces/bugtracker.py (+8/-0) lib/lp/bugs/model/bugtracker.py (+15/-1) lib/lp/bugs/stories/bugtracker/bugtrackers-index.txt (+6/-4) lib/lp/bugs/templates/bugtrackers-index.pt (+6/-4) lib/lp/bugs/tests/test_bugtracker.py (+28/-1) lib/lp/registry/browser/person.py (+5/-19) lib/lp/registry/browser/team.py (+0/-2) lib/lp/registry/browser/tests/test_team.py (+4/-10) lib/lp/testing/matchers.py (+47/-0) |
||||
| To merge this branch: | bzr merge lp:~lifeless/launchpad/malone | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Hudson-Doyle | 2010-09-19 | Approve on 2010-09-19 | |
|
Review via email:
|
|||
Commit Message
Batch /bugs/bugtrackers
Description of the Change
Batch the bug tracker lists - theres no point showing 1000 by default; the batching will also shrink the time massively; we can actually tune it later (this was sensible to do regardless and will give more headroom than just tuning it in the short term).
| Robert Collins (lifeless) wrote : | # |
Thanks for the feedback will do most of it.
I have a few quirks though:
- matchers inline - i agree, but the noddy style guide line wrapping
rules make it ugly. If you agree that inline is better even so, I'll
move it inline and wrap it the way I would in every other python
project.
- the flavor comment is there because its a deprecated API. I think
the deprecation is a mistake until we actually don't need it.
Thanks,
Rob
| Michael Hudson-Doyle (mwhudson) wrote : | # |
For the first, I don't think:
is too bad, but *shrug*, indent it however you like :)
For the second, fine.

The change is basically fine, and clearly a good idea. I have a number of code clarity comments though, see below.
> === modified file 'lib/canonical/ launchpad/ webapp/ batching. py' launchpad/ webapp/ batching. py 2010-09-06 18:52:45 +0000 launchpad/ webapp/ batching. py 2010-09-19 22:21:05 +0000 gator(BatchNavi gator): vigator( BatchNavigator) :
> --- lib/canonical/
> +++ lib/canonical/
> @@ -77,6 +77,24 @@
> return self.batch.total() > self.batch.size
>
>
> +class ActiveBatchNavi
> + """A paginator for active items.
> +
> + Used when a view needs to display more than one BatchNavigator of items.
> + """
> + start_variable_name = 'active_start'
> + batch_variable_name = 'active_batch'
> +
> +
> +class InactiveBatchNa
> + """A paginator for inactive items.
> +
> + Used when a view needs to display more than one BatchNavigator of items.
> + """
> + start_variable_name = 'inactive_start'
> + batch_variable_name = 'inactive_batch'
> +
> +
These are fine and clear enough -- are they generic enough to go in a
generic enough location though? Later: oh, I see you moved them from
other code. It's a shame you have to subclass to change these.
> class TableBatchNavig ator(BatchNavig ator): launchpad. interfaces. ITableBatchNavi gator." "" ITableBatchNavi gator)
> """See canonical.
> implements(
> === modified file 'lib/lp/ blueprints/ browser/ tests/test_ specificationta rget.py' blueprints/ browser/ tests/test_ specificationta rget.py 2010-09-17 14:04:29 +0000 blueprints/ browser/ tests/test_ specificationta rget.py 2010-09-19 22:21:05 +0000 launchpad. webapp. batching import BatchNavigator launchpad. testing. pages import find_tag_by_id testing. layers import DatabaseFunctio nalLayer interfaces. specificationta rget import ( tory, chNavigator initialized_ view, makePerson( ) initialized_ view(person, name='+ assignments' )
> --- lib/lp/
> +++ lib/lp/
> @@ -3,11 +3,9 @@
>
> __metaclass__ = type
>
> -import unittest
>
> from zope.security.proxy import removeSecurityProxy
>
> -from canonical.
> from canonical.
> from canonical.
> from lp.blueprints.
> @@ -21,6 +19,7 @@
> login_person,
> TestCaseWithFac
> )
> +from lp.testing.matchers import IsConfiguredBat
> from lp.testing.views import (
> create_view,
> create_
> @@ -108,22 +107,11 @@
> # subclass.
> person = self.factory.
> view = create_
Just up from here there's a comment:
# Some pages turn up in very large contexts and patch. E.g. signmentsView, a
# Distro:+assignments which uses SpecificationAs
# subclass.
Is patch a typo for batch here?
> - self.assertIsIn stance( view.specs_ batched, BatchNavigator) headings( self): makePerson( ) initialized_ view(person, name='+ assignments' ) l('specificatio n', navigator. _singular_ heading) l('specificatio ns', navigator. _plural_ heading) size(self) :
> -
> - def test_batch_
> - person = self.factory.
> - view = create_
> - navigator = view.specs_batched
> - self.assertEqua
> - self.assertEqua
> -
> - def test_batch_
> # Because +assignments is meant to provide an overview, we default to
> # 500 as the default batch size.
> - ...