[PATCH 1/3] Add geolocation module

Vratislav Podzimek vpodzime at redhat.com
Thu Apr 18 09:20:46 UTC 2013


On Thu, 2013-04-11 at 15:39 +0200, Martin Kolman wrote:
> The geolocation module exposes an API that makes it possible to get
> current territory code using either GeoIP or alternatively nearby WiFi
> access points. The module has multiple location backends, the default backend
> is using the Fedora MirrorManager. The geolocation module is a singleton,
> that is instantiated by the init_geolocation() call and refreshes geolocation info
> using a thread after refresh() is called.
> 
> If the module is not instantiated and/or refreshed, None is returned by
> the get_territory_code() and get_result() method.
> 
> If the module fails for some reason, it should not raise any exception,
> all errors will be logged instead.
> 
> Signed-off-by: Martin Kolman <mkolman at gmail.com>
> ---
>  pyanaconda/constants.py |  15 +
>  pyanaconda/geoloc.py    | 779 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 794 insertions(+)
>  create mode 100644 pyanaconda/geoloc.py

> +def init_geolocation(provider_id=constants.GEOLOC_PROVIDER_GOOGLE_WIFI):
This shouldn't be a default provider       ^^^^^


> +class MirrorManagerGeoIPProvider(GeolocationBackend):
> +    """The Fedora GeoIP service provider"""
> +
> +    API_URL = "https://mirrors.fedoraproject.org/" \
> +              "mirrorlist?repo=fedora-18&arch=i386"
We should use 'fedora-19' here. For the future releases the goal is to
request an API for GeoIP data from the Mirror Manager.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list