[Zope3-checkins] CVS: Zope3/src/zope/i18n - locales.py:1.3
Jim Fulton
jim@zope.com
Thu, 9 Jan 2003 09:13:48 -0500
Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv14386/src/zope/i18n
Modified Files:
locales.py
Log Message:
- Got rid of (essentially) unused validateMapping, validateMappingAll,
ValidationErrorsAll and ConversionErrorsAll.
- Renamed zope.app.interfaces.forms to zope.app.interfaces.form
- Changed the way form input errors are handled. Now, *only*
validation errors and widget input errors are caught and displayed
on forms. These errors are about data entry problems. For these, it
never makes sense to show a traceback.
For Python programming errors, we want tracebacks, so it's important
to handle them differently, but letting the propigate and get logged
by the error reporting service.
This required updating the widget code to be more careful about
errors raised.
=== Zope3/src/zope/i18n/locales.py 1.2 => 1.3 ===
--- Zope3/src/zope/i18n/locales.py:1.2 Mon Jan 6 11:35:11 2003
+++ Zope3/src/zope/i18n/locales.py Thu Jan 9 09:13:15 2003
@@ -273,146 +273,7 @@
return item[0]
def setWeekday(self, id, name, abbr):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._weekdays[id] = (name, abbr)
-
- def getWeekday(self, id):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._weekdays[id]
-
- def getWeekdayNames(self):
- "See zope.i18n.interfaces.ILocaleCalendar"
- names = []
- for id in range(1, 8):
- names.append(self._weekdays.get(id, (None, None))[0])
- return names
-
- def getWeekdayIdFromName(self, name):
- "See zope.i18n.interfaces.ILocaleCalendar"
- for item in self._weekdays.items():
- if item[1][0] == name:
- return item[0]
-
- def getWeekdayAbbr(self):
- "See zope.i18n.interfaces.ILocaleCalendar"
- abbrs = []
- for id in range(1, 8):
- abbrs.append(self._weekdays.get(id, (None, None))[1])
- return abbrs
-
- def getWeekdayIdFromAbbr(self, abbr):
- "See zope.i18n.interfaces.ILocaleCalendar"
- for item in self._weekdays.items():
- if item[1][1] == abbr:
- return item[0]
-
- def setEra(self, id, name):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._eras[id] = name
-
- def getEra(self, id):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._eras[id]
-
- def setAM(self, text):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._am = text
-
- def getAM(self):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._am
-
- def setPM(self, text):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._pm = text
-
- def getPM(self):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._pm
-
- def setPatternCharacters(self, chars):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._pattern_chars = chars
-
- def getPatternCharacters(self):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._pattern_chars
-
- def setTimePattern(self, type, pattern):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._time_patterns[type] = pattern
-
- def getTimePattern(self, type):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._time_patterns[type]
-
- def setDatePattern(self, name, pattern):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._date_patterns[name] = pattern
-
- def getDatePattern(self, name):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._date_patterns[name]
-
- def setDateTimePattern(self, pattern):
- "See zope.i18n.interfaces.ILocaleCalendar"
- self._datetime_pattern = pattern
-
- def getDateTimePattern(self):
- "See zope.i18n.interfaces.ILocaleCalendar"
- return self._datetime_pattern
-
-
-class ICULocaleNumberFormat:
- __doc__ = ILocaleNumberFormat.__doc__
-
- __implements__ = ILocaleNumberFormat
-
- def __init__(self, klass):
- """Initialize object."""
- self.klass = klass
- self._patterns = {}
- self._symbols = {}
-
- def setPattern(self, name, pattern):
- "See zope.i18n.interfaces.ILocaleNumberFormat"
- self._patterns[name] = pattern
-
- def getPattern(self, name):
- "See zope.i18n.interfaces.ILocaleNumberFormat"
- return self._patterns[name]
-
- def getAllPatternIds(self):
- "See zope.i18n.interfaces.ILocaleNumberFormat"
- return self._patterns.keys()
-
- def setSymbol(self, name, symbol):
- "See zope.i18n.interfaces.ILocaleNumberFormat"
- self._symbols[name] = symbol
-
- def getSymbol(self, name):
- "See zope.i18n.interfaces.ILocaleNumberFormat"
- return self._symbols[name]
-
- def getAllSymbolIds(self):
- "See zope.i18n.interfaces.ILocaleNumberFormat"
- return self._symbols.keys()
-
- def getSymbolMap(self):
- "See zope.i18n.interfaces.ILocaleNumberFormat"
- return self._symbols
-
-
-class ICULocaleCurrency:
- __doc__ = ILocaleCurrency.__doc__
-
- __implements__ = ILocaleCurrency
-
- def __init__(self, id):
- """Initialize object."""
- self.id = id
- self._symbol = None
- self._name = None
+ "See zope.i18n.i
self._decimal = None
self._pattern = None