These functions should be used later in the timezone spoke --- pyanaconda/localization.py | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/pyanaconda/localization.py b/pyanaconda/localization.py index f561557..75b2864 100644 --- a/pyanaconda/localization.py +++ b/pyanaconda/localization.py @@ -26,6 +26,7 @@ import os import re import babel +import pytz LOCALE_PREFERENCES = {} @@ -272,3 +273,24 @@ class Language(object): # XXX DEBUG print 'set system lang to "%s"' % self.system_lang + + +def get_all_timezones(territory): + if isinstance(territory, LocaleInfo): + territory = territory.territory + + try: + timezones = pytz.country_timezones(territory) + except KeyError: + timezones = list() + + return timezones + + +def get_preferred_timezone(territory): + try: + timezone = get_all_timezones(territory)[0] + except IndexError: + timezone = None + + return timezone -- 1.7.5.4 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list