[PATCH 3/4] Hook the Geolocation module to the Welcome spoke
Chris Lumens
clumens at redhat.com
Fri Apr 5 18:44:57 UTC 2013
> First, the module is initilized and asynchronous location info
> refresh is started. Then once the welcome spoke is initialized,
> it asks it for the territory code. If the code is unknown
> (either due to the lookup not returning any result or still
> being in progress), default value is used.
Just curious - how long have you found it takes to get the geoloc
refresh done? Will it be done in time for most people to make use of
it?
> diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py
> index 1f150c2..12c9361 100644
> --- a/pyanaconda/ui/gui/spokes/welcome.py
> +++ b/pyanaconda/ui/gui/spokes/welcome.py
> @@ -38,6 +38,7 @@ from pyanaconda.product import distributionText, isFinal, productName, productVe
> from pyanaconda import keyboard
> from pyanaconda import timezone
> from pyanaconda import flags
> +from pyanaconda import geoloc
>
> __all__ = ["WelcomeLanguageSpoke", "LanguageSpoke"]
>
> @@ -140,7 +141,7 @@ class LanguageMixIn(object):
> # TODO We can use the territory from geoip here
> # to preselect the translation, when it's available.
> # Until then, use None.
> - territory = None
> + territory = geoloc.get_territory_code()
> self.language = Language(LOCALE_PREFERENCES, territory=territory)
>
> # fill the list with available translations
Right now, get_territory_code is raising GeolocationError, so this is
going to result in a traceback here instead of None.
- Chris
More information about the anaconda-patches
mailing list