Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, localeID):
super( pdtLocale_icu, self ).__init__()
self.icu = None
if pyicu is not None:
if localeID is None:
localeID = 'en_US'
self.icu = pyicu.Locale(localeID)
if self.icu is not None:
# grab spelled out format of all numbers from 0 to 100
rbnf = pyicu.RuleBasedNumberFormat(pyicu.URBNFRuleSetTag.SPELLOUT, self.icu)
try:
self.numbers = dict([(rbnf.format(i), i) for i in xrange(0, 100)])
except NameError:
self.numbers = dict([(rbnf.format(i), i) for i in range(0, 100)])
def __init__(self, localeID):
super( pdtLocale_icu, self ).__init__()
self.icu = None
if pyicu is not None:
self.icu = pyicu.Locale(localeID)
if self.icu is not None:
self.symbols = pyicu.DateFormatSymbols(self.icu)
# grab ICU list of weekdays, skipping first entry which
# is always blank
wd = list(map(lcase, self.symbols.getWeekdays()[1:]))
swd = list(map(lcase, self.symbols.getShortWeekdays()[1:]))
# store them in our list with Monday first (ICU puts Sunday first)
self.Weekdays = wd[1:] + wd[0:1]
def __init__(self, localeID):
super( pdtLocale_icu, self ).__init__()
self.icu = None
if pyicu is not None:
if localeID is None:
localeID = 'en_US'
self.icu = pyicu.Locale(localeID)
if self.icu is not None:
# grab spelled out format of all numbers from 0 to 100
rbnf = pyicu.RuleBasedNumberFormat(pyicu.URBNFRuleSetTag.SPELLOUT, self.icu)
try:
self.numbers = dict([(rbnf.format(i), i) for i in xrange(0, 100)])
except NameError:
self.numbers = dict([(rbnf.format(i), i) for i in range(0, 100)])