[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/i18n/locales/xmlfactory.py Backport rev 26007.

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 12 09:57:21 EDT 2004


Log message for revision 27046:
  Backport rev 26007.
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/i18n/locales/xmlfactory.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/i18n/locales/xmlfactory.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/i18n/locales/xmlfactory.py	2004-08-12 13:51:34 UTC (rev 27045)
+++ Zope3/branches/ZopeX3-3.0/src/zope/i18n/locales/xmlfactory.py	2004-08-12 13:57:20 UTC (rev 27046)
@@ -279,7 +279,9 @@
                 elements[type] = self._getText(element.childNodes)
             setattr(displayNames, group_tag, elements)
 
-        displayNames.types = self._extractTypes(names_nodes[0])
+        types = self._extractTypes(names_nodes[0])
+        if types is not None:
+            displayNames.types = types
         return displayNames
 
 
@@ -845,8 +847,12 @@
             return
 
         dates = LocaleDates()
-        dates.calendars = self._extractCalendars(dates_nodes[0])
-        dates.timezones = self._extractTimeZones(dates_nodes[0])
+        calendars = self._extractCalendars(dates_nodes[0])
+        if calendars is not None:
+            dates.calendars = calendars
+        timezones = self._extractTimeZones(dates_nodes[0])
+        if timezones is not None:
+            dates.timezones = timezones
         return dates
 
 
@@ -1074,9 +1080,13 @@
             return
 
         numbers = LocaleNumbers()
-        numbers.symbols = self._extractSymbols(numbers_nodes[0])
+        symbols = self._extractSymbols(numbers_nodes[0])
+        if symbols is not None: 
+            numbers.symbols = symbols
         self._extractNumberFormats(numbers_nodes[0], numbers)
-        numbers.currencies = self._extractCurrencies(numbers_nodes[0])
+        currencies = self._extractCurrencies(numbers_nodes[0])
+        if currencies is not None:
+            numbers.currencies = currencies
         return numbers
     
 
@@ -1129,10 +1139,22 @@
     def __call__(self):
         """Create the Locale."""
         locale = Locale(self._extractIdentity())
-        locale.displayNames = self._extractDisplayNames()
-        locale.dates = self._extractDates()
-        locale.numbers = self._extractNumbers()
-        locale.delimiters = self._extractDelimiters
+
+        names = self._extractDisplayNames()
+        if names is not None:
+            locale.displayNames = names 
+
+        dates = self._extractDates()
+        if dates is not None:
+            locale.dates = dates
+
+        numbers = self._extractNumbers()
+        if numbers is not None:
+            locale.numbers = numbers
+
+        delimiters = self._extractDelimiters()
+        if delimiters is not None:
+            locale.delimiters = delimiters
         
         # Unmapped:
         #



More information about the Zope3-Checkins mailing list