Update of /cvsroot/webware/Webware/MiddleKit/Core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26665/Core
Modified Files:
MiddleDict.py
Log Message:
- Enhance boolForKey() to take an optional default value argument.
Index: MiddleDict.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Core/MiddleDict.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MiddleDict.py 3 Apr 2004 04:01:38 -0000 1.1
--- MiddleDict.py 25 Aug 2004 15:26:54 -0000 1.2
***************
*** 12,16 ****
"""
! def boolForKey(self, key):
"""
Returns True or False for the given key. Returns False if the
--- 12,16 ----
"""
! def boolForKey(self, key, default=False):
"""
Returns True or False for the given key. Returns False if the
***************
*** 18,22 ****
exists, but cannot be parsed as a bool.
"""
! original = self.get(key, '')
s = original
if isinstance(s, StringTypes):
--- 18,22 ----
exists, but cannot be parsed as a bool.
"""
! original = self.get(key, default)
s = original
if isinstance(s, StringTypes):
|