mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Whitespace normalization.
This commit is contained in:
parent
752d3f557e
commit
88869f9787
16 changed files with 1168 additions and 1170 deletions
|
@ -73,16 +73,16 @@ ConfigParser -- responsible for for parsing a list of
|
|||
1, only)
|
||||
|
||||
remove_section(section)
|
||||
remove the given file section and all its options
|
||||
remove the given file section and all its options
|
||||
|
||||
remove_option(section, option)
|
||||
remove the given option from the given section
|
||||
remove the given option from the given section
|
||||
|
||||
set(section, option, value)
|
||||
set the given option
|
||||
|
||||
write(fp)
|
||||
write the configuration state in .ini format
|
||||
write the configuration state in .ini format
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
@ -94,7 +94,7 @@ DEFAULTSECT = "DEFAULT"
|
|||
MAX_INTERPOLATION_DEPTH = 10
|
||||
|
||||
|
||||
|
||||
|
||||
# exception classes
|
||||
class Error(Exception):
|
||||
def __init__(self, msg=''):
|
||||
|
@ -166,7 +166,7 @@ class MissingSectionHeaderError(ParsingError):
|
|||
self.line = line
|
||||
|
||||
|
||||
|
||||
|
||||
class ConfigParser:
|
||||
def __init__(self, defaults=None):
|
||||
self.__sections = {}
|
||||
|
@ -217,7 +217,7 @@ class ConfigParser:
|
|||
|
||||
def read(self, filenames):
|
||||
"""Read and parse a filename or a list of filenames.
|
||||
|
||||
|
||||
Files that cannot be opened are silently ignored; this is
|
||||
designed so that you can specify a list of potential
|
||||
configuration file locations (e.g. current directory, user's
|
||||
|
@ -285,7 +285,7 @@ class ConfigParser:
|
|||
|
||||
# do the string interpolation
|
||||
value = rawval # Make it a pretty variable name
|
||||
depth = 0
|
||||
depth = 0
|
||||
while depth < 10: # Loop through this until it's done
|
||||
depth = depth + 1
|
||||
if string.find(value, "%(") >= 0:
|
||||
|
@ -298,7 +298,7 @@ class ConfigParser:
|
|||
if value.find("%(") >= 0:
|
||||
raise InterpolationDepthError(option, section, rawval)
|
||||
return value
|
||||
|
||||
|
||||
def __get(self, section, conv, option):
|
||||
return conv(self.get(section, option))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue