|
52 | 52 | The filename defaults to fp.name; it is only used in error |
53 | 53 | messages (if fp has no `name' attribute, the string `<???>' is used). |
54 | 54 |
|
55 | | - get(section, option, raw=0, vars=None) |
| 55 | + get(section, option, raw=False, vars=None) |
56 | 56 | return a string value for the named option. All % interpolations are |
57 | 57 | expanded in the return values, based on the defaults passed into the |
58 | 58 | constructor and the DEFAULT section. Additional substitutions may be |
|
67 | 67 |
|
68 | 68 | getboolean(section, options) |
69 | 69 | like get(), but convert value to a boolean (currently case |
70 | | - insensitively defined as 0, false, no, off for 0, and 1, true, |
71 | | - yes, on for 1). Returns 0 or 1. |
| 70 | + insensitively defined as 0, false, no, off for False, and 1, true, |
| 71 | + yes, on for True). Returns False or True. |
72 | 72 |
|
73 | | - items(section, raw=0, vars=None) |
| 73 | + items(section, raw=False, vars=None) |
74 | 74 | return a list of tuples with (name, value) for each option |
75 | 75 | in the section. |
76 | 76 |
|
@@ -308,7 +308,7 @@ def has_option(self, section, option): |
308 | 308 | option = self.optionxform(option) |
309 | 309 | return option in self._defaults |
310 | 310 | elif section not in self._sections: |
311 | | - return 0 |
| 311 | + return False |
312 | 312 | else: |
313 | 313 | option = self.optionxform(option) |
314 | 314 | return (option in self._sections[section] |
@@ -393,7 +393,7 @@ def _read(self, fp, fpname): |
393 | 393 | optname = None |
394 | 394 | lineno = 0 |
395 | 395 | e = None # None, or an exception |
396 | | - while 1: |
| 396 | + while True: |
397 | 397 | line = fp.readline() |
398 | 398 | if not line: |
399 | 399 | break |
@@ -459,7 +459,7 @@ def _read(self, fp, fpname): |
459 | 459 |
|
460 | 460 | class ConfigParser(RawConfigParser): |
461 | 461 |
|
462 | | - def get(self, section, option, raw=0, vars=None): |
| 462 | + def get(self, section, option, raw=False, vars=None): |
463 | 463 | """Get an option value for a given section. |
464 | 464 |
|
465 | 465 | All % interpolations are expanded in the return values, based on the |
@@ -490,7 +490,7 @@ def get(self, section, option, raw=0, vars=None): |
490 | 490 | else: |
491 | 491 | return self._interpolate(section, option, value, d) |
492 | 492 |
|
493 | | - def items(self, section, raw=0, vars=None): |
| 493 | + def items(self, section, raw=False, vars=None): |
494 | 494 | """Return a list of tuples with (name, value) for each option |
495 | 495 | in the section. |
496 | 496 |
|
|
0 commit comments