From: Alex Morega Date: Thu, 4 Jul 2013 17:22:31 +0000 (+0200) Subject: ignore `uncommon` parameter X-Git-Tag: 1.0~129^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab9d1be8c75ca3f9adc3a227f3eb03328105ccd1;p=thirdparty%2Fbabel.git ignore `uncommon` parameter The CLDR removed commonlyUsed information about timezone aliases: http://www.unicode.org/reports/tr35/tr35-29.html#Timezone_Names (search for "commonlyUsed") --- diff --git a/babel/dates.py b/babel/dates.py index 9c008bc9..856ea95f 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -339,25 +339,13 @@ def get_timezone_name(dt_or_tzinfo=None, width='long', uncommon=False, >>> get_timezone_name(tz, locale='de_DE') u"Kanada (St. John's)" - The `uncommon` parameter can be set to `True` to enable the use of timezone - representations that are not commonly used by the requested locale. For - example, while in French the central European timezone is usually - abbreviated as "HEC", in Canadian French, this abbreviation is not in - common use, so a generic name would be chosen by default: - - >>> tz = timezone('Europe/Paris') - >>> get_timezone_name(tz, 'short', locale='fr_CA') - u'France' - >>> get_timezone_name(tz, 'short', uncommon=True, locale='fr_CA') - u'HEC' - :param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines the timezone; if a ``tzinfo`` object is used, the resulting display name will be generic, i.e. independent of daylight savings time; if `None`, the current date in UTC is assumed :param width: either "long" or "short" - :param uncommon: whether even uncommon timezone abbreviations should be used + :param uncommon: deprecated and ignored :param locale: the `Locale` object, or a locale string :return: the timezone display name :rtype: `unicode` @@ -406,7 +394,7 @@ def get_timezone_name(dt_or_tzinfo=None, width='long', uncommon=False, metazone = get_global('meta_zones').get(zone) if metazone: metazone_info = locale.meta_zones.get(metazone, {}) - if width in metazone_info and (uncommon or metazone_info.get('common')): + if width in metazone_info: if dt is None: field = 'generic' else: diff --git a/scripts/import_cldr.py b/scripts/import_cldr.py index 67f82652..acf181b1 100755 --- a/scripts/import_cldr.py +++ b/scripts/import_cldr.py @@ -318,7 +318,6 @@ def main(): info.setdefault('long', {})[child.tag] = unicode(child.text) for child in elem.findall('short/*'): info.setdefault('short', {})[child.tag] = unicode(child.text) - info['common'] = elem.findtext('commonlyUsed') == 'true' meta_zones[elem.attrib['type']] = info for calendar in tree.findall('.//calendars/calendar'):