[Zope-Checkins] CVS: ZODB3/ZConfig - StorageTypes.py:1.2
Guido van Rossum
guido@python.org
Fri, 22 Nov 2002 12:35:25 -0500
Update of /cvs-repository/ZODB3/ZConfig
In directory cvs.zope.org:/tmp/cvs-serv21578
Modified Files:
StorageTypes.py
Log Message:
Make asBoolean() use the same definition of a Boolean string as
section.getBool(). This could be refactored to share more code. :-)
=== ZODB3/ZConfig/StorageTypes.py 1.1 => 1.2 ===
--- ZODB3/ZConfig/StorageTypes.py:1.1 Fri Nov 22 11:16:37 2002
+++ ZODB3/ZConfig/StorageTypes.py Fri Nov 22 12:35:24 2002
@@ -23,9 +23,9 @@
if not s:
return 0
ss = str(s).lower()
- if ss in ('1', 'y', 't', 'yes', 'true', 'on'):
+ if ss in ('yes', 'true', 'on'):
return 1
- elif ss in ('0', 'n', 'f', 'no', 'false', 'off'):
+ elif ss in ('no', 'false', 'off'):
return 0
else:
raise ValueError, 'Not a boolean value: %s' % s