Merge lp:~jpds/launchpad/fix_517839 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Tim Penhey on 2010-02-22 |
| Approved revision: | not available |
| Merged at revision: | 10377 |
| Proposed branch: | lp:~jpds/launchpad/fix_517839 |
| Merge into: | lp:launchpad |
| Diff against target: |
413 lines (+206/-20) 11 files modified
lib/canonical/launchpad/browser/launchpad.py (+2/-0) lib/canonical/launchpad/security.py (+6/-0) lib/lp/registry/interfaces/distributionmirror.py (+7/-4) lib/lp/registry/stories/webservice/xx-distribution-mirror.txt (+23/-1) lib/lp/registry/stories/webservice/xx-distribution.txt (+1/-0) lib/lp/services/worlddata/browser/configure.zcml (+28/-0) lib/lp/services/worlddata/browser/country.py (+10/-0) lib/lp/services/worlddata/configure.zcml (+2/-0) lib/lp/services/worlddata/interfaces/country.py (+43/-15) lib/lp/services/worlddata/model/country.py (+12/-0) lib/lp/services/worlddata/stories/webservice/xx-country.txt (+72/-0) |
| To merge this branch: | bzr merge lp:~jpds/launchpad/fix_517839 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Tim Penhey (community) | Approve on 2010-02-22 | ||
| Canonical Launchpad Engineering | code | 2010-02-20 | Pending |
|
Review via email:
|
|||
Commit Message
Exported countries and DistributionMir
| Jonathan Davies (jpds) wrote : | # |
| Tim Penhey (thumper) wrote : | # |
Mostly small style issues.
> === added file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -0,0 +1,10 @@
> +# Copyright 2009 Canonical Ltd. This software is licensed under the
> +# GNU Affero General Public License version 3 (see the file LICENSE).
It is 2010 now :-)
> +
> +from lp.services.
> +
> +from canonical.
> + GetitemNavigation)
This can fit on one line.
2 blank lines between module level bits.
> +
> +class CountrySetNavig
> + usedfor = ICountrySet
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -20,26 +20,32 @@
> from canonical.
> from canonical.launchpad import _
>
> +from lazr.restful.
> + export_
> + export_
> + operation_
> +
> class ICountry(
> """The country description."""
> + export_
>
> id = Int(
> title=_('Country ID'), required=True, readonly=True,
> )
> - iso3166code2 = TextLine( title=_
> - readonly=True)
> - iso3166code3 = TextLine( title=_
> - readonly=True)
> - name = TextLine(
> + iso3166code2 = exported(TextLine( title=_
> + readonly=True))
> + iso3166code3 = exported(TextLine( title=_
> + readonly=True))
These could be formatted a little nicer :)
> + name = exported(TextLine(
> title=_('Country name'), required=True,
> constraint=
> - )
> - title = Title(
> + ))
> + title = exported(Title(
> title=_('Country title'), required=True,
> - )
> - description = Description(
> + ))
> + description = exported(
> title=_
> - )
> + ))
>
> continent = Attribute("The Continent where this country is located.")
> languages = Attribute("An iterator over languages that are spoken in "
> @@ -48,6 +54,7 @@
>
> class ICountrySet(
> """A container for countries."""
> + export_
>
> def __getitem__(key):
> """Get a country."""
> @@ -55,6 +62,24 @@
> def __iter__():
> """Iterate through the countries in this set."""
>
> + @operation_
> + name=TextLine(
> + @operation_...

= Summary =
As per bug #517839, we should export the country attribute of DistributionMir ror's. This is to compliment bug #361650 later on.
= Pre-implementation details =
I spoke to Curtis, who said that the simplest fix would be to register a canonical URL for country. I have done this by exporting countries as +countries/$CC.
= Tests =
Newly exported Country's can be tested with:
bin/test -vvct webservice/ xx-country. txt
And DistributionMirror changes:
bin/test -vvct webservice/ xx-distribution -mirror. txt
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ security. py /launchpad/ browser/ launchpad. py registry/ interfaces/ distributionmir ror.py registry/ stories/ webservice/ xx-distribution -mirror. txt services/ worlddata/ browser/ services/ worlddata/ configure. zcml services/ worlddata/ stories/ services/ worlddata/ browser/ __init_ _.py services/ worlddata/ browser/ configure. zcml services/ worlddata/ browser/ country. py services/ worlddata/ interfaces/ country. py services/ worlddata/ model/country. py services/ worlddata/ stories/ webservice/ services/ worlddata/ stories/ webservice/ xx-country. txt
lib/canonical
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/