Mailing List Archive

python/dist/src/Lib ConfigParser.py,1.52,1.53
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv12198/Lib

Modified Files:
ConfigParser.py
Log Message:
Update doc for getboolean() to match code (ie, returning True/False)
Convert remaining uses of 1/0 to True/False


Index: ConfigParser.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** ConfigParser.py 9 Nov 2002 05:08:06 -0000 1.52
--- ConfigParser.py 17 Dec 2002 01:56:47 -0000 1.53
***************
*** 53,57 ****
messages (if fp has no `name' attribute, the string `<???>' is used).

! get(section, option, raw=0, vars=None)
return a string value for the named option. All % interpolations are
expanded in the return values, based on the defaults passed into the
--- 53,57 ----
messages (if fp has no `name' attribute, the string `<???>' is used).

! get(section, option, raw=False, vars=None)
return a string value for the named option. All % interpolations are
expanded in the return values, based on the defaults passed into the
***************
*** 68,75 ****
getboolean(section, options)
like get(), but convert value to a boolean (currently case
! insensitively defined as 0, false, no, off for 0, and 1, true,
! yes, on for 1). Returns 0 or 1.

! items(section, raw=0, vars=None)
return a list of tuples with (name, value) for each option
in the section.
--- 68,75 ----
getboolean(section, options)
like get(), but convert value to a boolean (currently case
! insensitively defined as 0, false, no, off for False, and 1, true,
! yes, on for True). Returns False or True.

! items(section, raw=False, vars=None)
return a list of tuples with (name, value) for each option
in the section.
***************
*** 309,313 ****
return option in self._defaults
elif section not in self._sections:
! return 0
else:
option = self.optionxform(option)
--- 309,313 ----
return option in self._defaults
elif section not in self._sections:
! return False
else:
option = self.optionxform(option)
***************
*** 394,398 ****
lineno = 0
e = None # None, or an exception
! while 1:
line = fp.readline()
if not line:
--- 394,398 ----
lineno = 0
e = None # None, or an exception
! while True:
line = fp.readline()
if not line:
***************
*** 460,464 ****
class ConfigParser(RawConfigParser):

! def get(self, section, option, raw=0, vars=None):
"""Get an option value for a given section.

--- 460,464 ----
class ConfigParser(RawConfigParser):

! def get(self, section, option, raw=False, vars=None):
"""Get an option value for a given section.

***************
*** 491,495 ****
return self._interpolate(section, option, value, d)

! def items(self, section, raw=0, vars=None):
"""Return a list of tuples with (name, value) for each option
in the section.
--- 491,495 ----
return self._interpolate(section, option, value, d)

! def items(self, section, raw=False, vars=None):
"""Return a list of tuples with (name, value) for each option
in the section.