[Zope-Checkins] CVS: Zope/lib/python/DateTime - DateTime.py:1.82.8.6

Andreas Jung andreas@andreas-jung.com
Wed, 22 Jan 2003 00:34:20 -0500


Update of /cvs-repository/Zope/lib/python/DateTime
In directory cvs.zope.org:/tmp/cvs-serv29222

Modified Files:
      Tag: ajung-european-datetime-support-branch
	DateTime.py 
Log Message:
removed checking the locales to determine the default time format
since might break compatiblity. Using this new feature
must specified explict through the environment or the API
but not through some implicit assertions.


=== Zope/lib/python/DateTime/DateTime.py 1.82.8.5 => 1.82.8.6 ===
--- Zope/lib/python/DateTime/DateTime.py:1.82.8.5	Tue Dec  3 14:27:53 2002
+++ Zope/lib/python/DateTime/DateTime.py	Wed Jan 22 00:34:17 2003
@@ -22,17 +22,8 @@
 try: from time import tzname
 except: tzname=('UNKNOWN','UNKNOWN')
 
-# sniff into locales to determine datetime format
-_default_fmt = 'us'
 
-try:
-    import locale
-    loc = locale.setlocale(locale.LC_ALL) # get current locale
-    fmt = locale.nl_langinfo(locale.D_FMT)
-    if fmt.startswith('%d'): _default_fmt = 'international'
-except: pass
-
-_default_datefmt = os.environ.get('DATETIME_FORMAT', _default_fmt).lower()
+_default_datefmt = os.environ.get('DATETIME_FORMAT', "us").lower()
 if not _default_datefmt in ('us', 'international'):
     raise ValueError, "DATETIME_FORMAT must be either 'us' or 'international'"