As Stuart commented, this will need a pagetest. In fact, there is
already one that is probably broken by this change. Have a look at the
end of lib/lp/registry/stories/foaf/xx-person-home.txt.
Did you have a mentor for this branch, or a pre-implementation
discussion? Perhaps that might have spotted the need to update the
pagetest. Have a look at https://dev.launchpad.net/PatchSubmission if
you haven't already. It's the same process as all the Launchpad devs
from Canonical use.
I have a comment about the code, because the cmp argument to sorted()
is deprecated (and I think it's gone entirely in Python 3).
Hi Jamal,
Thank you for working on this bug!
As Stuart commented, this will need a pagetest. In fact, there is registry/ stories/ foaf/xx- person- home.txt.
already one that is probably broken by this change. Have a look at the
end of lib/lp/
Did you have a mentor for this branch, or a pre-implementation /dev.launchpad. net/PatchSubmis sion if
discussion? Perhaps that might have spotted the need to update the
pagetest. Have a look at https:/
you haven't already. It's the same process as all the Launchpad devs
from Canonical use.
I have a comment about the code, because the cmp argument to sorted()
is deprecated (and I think it's gone entirely in Python 3).
Thanks again!
Gavin.
> === modified file 'lib/lp/ registry/ browser/ person. py' registry/ browser/ person. py 2009-07-29 15:34:46 +0000 registry/ browser/ person. py 2009-07-31 21:12:09 +0000 update( category for category in contrib[ 'categories' ]) 'title' )) 'name') ,
> --- lib/lp/
> +++ lib/lp/
> @@ -2517,7 +2517,10 @@
> categories = set()
> for contrib in self.contributions:
> categories.
> - return sorted(categories, key=attrgetter(
> + sort = {'code': 0, 'bugs': 1, 'blueprints': 2, 'translations': 3,
> + 'answers': 4, 'specs': 5, 'soyuz': 6}
> + return sorted(categories, key=attrgetter(
> + cmp=lambda x,y: cmp(sort[x], sort[y]))
Because cmp is deprecated, I think this would be better as:
return sorted(categories, key=lambda category: sort[category. name])
> is_probably_ a_team( self):
> @cachedproperty
> def context_