I like this branch; nice work. Couple of minor changes needed, but
nothing that isn't just nitpicking. I've also posed a question about
performance, but I'm not sure that we can do much about at this point.
You should get a UI review for this branch from one of our sainted UI
reviewers before you land it.
> === modified file 'lib/lp/registry/browser/person.py'
> --- lib/lp/registry/browser/person.py 2010-09-10 12:24:03 +0000
> +++ lib/lp/registry/browser/person.py 2010-09-10 22:30:12 +0000
> @@ -2396,6 +2397,42 @@
> return self.getSearchPageHeading()
>
>
> +class PersonSubscriptionsView(BugTaskSearchListingView):
> + """All the subscriptions for a person."""
> +
> + page_title = 'Subscriptions'
> +
> + def subscribedBugTasks(self):
> + """Return a BatchNavigator for distinct bug tasks to which the
> + person is subscribed."""
> + bugtasks = self.context.searchTasks(None, user=self.user,
Hi Brian,
I like this branch; nice work. Couple of minor changes needed, but
nothing that isn't just nitpicking. I've also posed a question about
performance, but I'm not sure that we can do much about at this point.
You should get a UI review for this branch from one of our sainted UI
reviewers before you land it.
> === modified file 'lib/lp/ registry/ browser/ person. py' registry/ browser/ person. py 2010-09-10 12:24:03 +0000 registry/ browser/ person. py 2010-09-10 22:30:12 +0000 ageHeading( ) ionsView( BugTaskSearchLi stingView) : sks(self) : searchTasks( None, user=self.user,
> --- lib/lp/
> +++ lib/lp/
> @@ -2396,6 +2397,42 @@
> return self.getSearchP
>
>
> +class PersonSubscript
> + """All the subscriptions for a person."""
> +
> + page_title = 'Subscriptions'
> +
> + def subscribedBugTa
> + """Return a BatchNavigator for distinct bug tasks to which the
> + person is subscribed."""
> + bugtasks = self.context.
bugtasks => bug_tasks.
> + order_by= '-date_ last_updated' , (BugTaskStatus. NEW, INCOMPLETE, CONFIRMED, TRIAGED, INPROGRESS, FIXCOMMITTED, FIXRELEASED) )
> + status=
> + BugTaskStatus.
> + BugTaskStatus.
> + BugTaskStatus.
> + BugTaskStatus.
> + BugTaskStatus.
> + BugTaskStatus.
You can outdent all of this by four spaces; we use four-space indents
per level in method calls.
> + append( task) append( task.bug)
> + sub_bugtasks = []
> + sub_bugs = []
> +
> + for task in bugtasks:
> + if task.bug not in sub_bugs:
> + sub_bugtasks.
> + sub_bugs.
Is this loop going to cause performance problems for people with a large
number of direct subscriptions?
> + return BatchNavigator( sub_bugtasks, self.request) sPageHeading( self): displayname ptionsPageHeadi ng() iew(LaunchpadFo rmView) : registry/ stories/ person/ xx-person- subscriptions. txt' registry/ stories/ person/ xx-person- subscriptions. txt 1970-01-01 00:00:00 +0000 registry/ stories/ person/ xx-person- subscriptions. txt 2010-09-10 22:30:12 +0000 launchpad. dev/~ubuntu- team/+subscript ions') text(find_ main_content( anon_browser. contents) ) launchpad. dev/~name12/ +subscriptions') contents, 'bug_subscripti ons') table.findAll( 'tr'): auth='Basic <email address hidden>:test')
> +
> + def getSubscription
> + """The header for the subscriptions page."""
> + return "Subscriptions for %s" % self.context.
> +
> + @property
> + def label(self):
> + return self.getSubscri
> +
> +
> class PersonVouchersV
> """Form for displaying and redeeming commercial subscription vouchers."""
>
> === added file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -0,0 +1,56 @@
> +Subscriptions View
> +==================
> +
> +Direct bug subscriptions
> +
> +Each person and team has a subscriptions page that lists things to which they
> +are directly subscribed.
> +
> + >>> anon_browser.open('http://
> + >>> print anon_browser.title
> + Subscriptions : “Ubuntu Team” team
> +
> +The bug subscriptions table does not appear for people without any direct bug
> +subscriptions.
> +
> + >>> page_text = extract_
> + >>> "does not have any direct bug subscriptions" in page_text
> + True
> +
> +The bug subscriptions table does appear for someone with direct bug
> +subscriptions and includes the bug number, title and location.
> +
> + >>> anon_browser.open('http://
> + >>> bug_sub_table = find_tag_by_id(
> + ... anon_browser.
> + >>> for tr in bug_sub_
> + ... print extract_text(tr)
> + Summary
> + In
> + 13
> + Launchpad CSS and JS is not testible
> + Launchpad
> + 5
> + Firefox install instructions should be complete
> + mozilla-firefox (Ubuntu Warty)
> + 4
> + Reflow problems with complex page layouts
> + Mozilla Firefox
> + 2
> + Blackhole Trash folder
> + mozilla-firefox (Debian Woody)
> + 9
> + Thunderbird crashes
> + thunderbird (Ubuntu)
> +
> +
> +The bug subscriptions table also includes an unsubscribe link for bugs to
> +which the person or team is subscribed.
> +
> + >>> browser = setupBrowser(
You can use user_browser here instead of creating your own.
> + >>> browser.open('http:// launchpad. dev/~name12/ +subscriptions') -subscriber- 12') bugs.launchpad. dev/launchpad/ +bug/12/ +subscribe
> + >>> unsub_link = browser.getLink(
> + ... id='unsubscribe
> + >>> unsub_link.click()
> + >>> print browser.url
> + http://