1919 inline_comment_prefixes=None, strict=True,
2020 empty_lines_in_values=True, default_section='DEFAULT',
2121 interpolation=<unset>, converters=<unset>):
22- Create the parser. When `defaults' is given, it is initialized into the
22+
23+ Create the parser. When `defaults` is given, it is initialized into the
2324 dictionary or intrinsic defaults. The keys must be strings, the values
2425 must be appropriate for %()s string interpolation.
2526
26- When `dict_type' is given, it will be used to create the dictionary
27+ When `dict_type` is given, it will be used to create the dictionary
2728 objects for the list of sections, for the options within a section, and
2829 for the default values.
2930
30- When `delimiters' is given, it will be used as the set of substrings
31+ When `delimiters` is given, it will be used as the set of substrings
3132 that divide keys from values.
3233
33- When `comment_prefixes' is given, it will be used as the set of
34+ When `comment_prefixes` is given, it will be used as the set of
3435 substrings that prefix comments in empty lines. Comments can be
3536 indented.
3637
37- When `inline_comment_prefixes' is given, it will be used as the set of
38+ When `inline_comment_prefixes` is given, it will be used as the set of
3839 substrings that prefix comments in non-empty lines.
3940
4041 When `strict` is True, the parser won't allow for any section or option
4142 duplicates while reading from a single source (file, string or
4243 dictionary). Default is True.
4344
44- When `empty_lines_in_values' is False (default: True), each empty line
45+ When `empty_lines_in_values` is False (default: True), each empty line
4546 marks the end of an option. Otherwise, internal empty lines of
4647 a multiline option are kept as part of the value.
4748
48- When `allow_no_value' is True (default: False), options without
49+ When `allow_no_value` is True (default: False), options without
4950 values are accepted; the value presented for these is None.
5051
51- When `default_section' is given, the name of the special section is
52+ When `default_section` is given, the name of the special section is
5253 named accordingly. By default it is called ``"DEFAULT"`` but this can
5354 be customized to point to any other valid section name. Its current
5455 value can be retrieved using the ``parser_instance.default_section``
8788 read_file(f, filename=None)
8889 Read and parse one configuration file, given as a file object.
8990 The filename defaults to f.name; it is only used in error
90- messages (if f has no `name' attribute, the string `<???>' is used).
91+ messages (if f has no `name` attribute, the string `<???>` is used).
9192
9293 read_string(string)
9394 Read configuration from a given string.
103104 Return a string value for the named option. All % interpolations are
104105 expanded in the return values, based on the defaults passed into the
105106 constructor and the DEFAULT section. Additional substitutions may be
106- provided using the `vars' argument, which must be a dictionary whose
107- contents override any pre-existing defaults. If `option' is a key in
108- `vars' , the value from `vars' is used.
107+ provided using the `vars` argument, which must be a dictionary whose
108+ contents override any pre-existing defaults. If `option` is a key in
109+ `vars` , the value from `vars` is used.
109110
110111 getint(section, options, raw=False, vars=None, fallback=_UNSET)
111112 Like get(), but convert value to an integer.
134135
135136 write(fp, space_around_delimiters=True)
136137 Write the configuration state in .ini format. If
137- `space_around_delimiters' is True (the default), delimiters
138+ `space_around_delimiters` is True (the default), delimiters
138139 between keys and values are surrounded by spaces.
139140"""
140141
@@ -323,7 +324,7 @@ def __init__(self, filename, lineno, line):
323324
324325
325326# Used in parser getters to indicate the default behaviour when a specific
326- # option is not found it to raise an exception. Created to enable `None' as
327+ # option is not found it to raise an exception. Created to enable `None` as
327328# a valid fallback value.
328329_UNSET = object ()
329330
@@ -357,7 +358,7 @@ class BasicInterpolation(Interpolation):
357358 would resolve the "%(dir)s" to the value of dir. All reference
358359 expansions are done late, on demand. If a user needs to use a bare % in
359360 a configuration file, she can escape it by writing %%. Other % usage
360- is considered a user error and raises `InterpolationSyntaxError' ."""
361+ is considered a user error and raises `InterpolationSyntaxError` ."""
361362
362363 _KEYCRE = re .compile (r"%\(([^)]+)\)s" )
363364
@@ -418,7 +419,7 @@ def _interpolate_some(self, parser, option, accum, rest, section, map,
418419
419420class ExtendedInterpolation (Interpolation ):
420421 """Advanced variant of interpolation, supports the syntax used by
421- `zc.buildout' . Enables interpolation between sections."""
422+ `zc.buildout` . Enables interpolation between sections."""
422423
423424 _KEYCRE = re .compile (r"\$\{([^}]+)\}" )
424425
@@ -691,10 +692,10 @@ def read(self, filenames, encoding=None):
691692 def read_file (self , f , source = None ):
692693 """Like read() but the argument must be a file-like object.
693694
694- The `f' argument must be iterable, returning one line at a time.
695- Optional second argument is the `source' specifying the name of the
696- file being read. If not given, it is taken from f.name. If `f' has no
697- `name' attribute, `<???>' is used.
695+ The `f` argument must be iterable, returning one line at a time.
696+ Optional second argument is the `source` specifying the name of the
697+ file being read. If not given, it is taken from f.name. If `f` has no
698+ `name` attribute, `<???>` is used.
698699 """
699700 if source is None :
700701 try :
@@ -718,7 +719,7 @@ def read_dict(self, dictionary, source='<dict>'):
718719 All types held in the dictionary are converted to strings during
719720 reading, including section names, option names and keys.
720721
721- Optional second argument is the `source' specifying the name of the
722+ Optional second argument is the `source` specifying the name of the
722723 dictionary being read.
723724 """
724725 elements_added = set ()
@@ -742,15 +743,15 @@ def read_dict(self, dictionary, source='<dict>'):
742743 def get (self , section , option , * , raw = False , vars = None , fallback = _UNSET ):
743744 """Get an option value for a given section.
744745
745- If `vars' is provided, it must be a dictionary. The option is looked up
746- in `vars' (if provided), `section' , and in `DEFAULTSECT' in that order.
747- If the key is not found and `fallback' is provided, it is used as
748- a fallback value. `None' can be provided as a `fallback' value.
746+ If `vars` is provided, it must be a dictionary. The option is looked up
747+ in `vars` (if provided), `section` , and in `DEFAULTSECT` in that order.
748+ If the key is not found and `fallback` is provided, it is used as
749+ a fallback value. `None` can be provided as a `fallback` value.
749750
750- If interpolation is enabled and the optional argument `raw' is False,
751+ If interpolation is enabled and the optional argument `raw` is False,
751752 all interpolations are expanded in the return values.
752753
753- Arguments `raw' , `vars' , and `fallback' are keyword only.
754+ Arguments `raw` , `vars` , and `fallback` are keyword only.
754755
755756 The section DEFAULT is special.
756757 """
@@ -810,8 +811,8 @@ def items(self, section=_UNSET, raw=False, vars=None):
810811
811812 All % interpolations are expanded in the return values, based on the
812813 defaults passed into the constructor, unless the optional argument
813- `raw' is true. Additional substitutions may be provided using the
814- `vars' argument, which must be a dictionary whose contents overrides
814+ `raw` is true. Additional substitutions may be provided using the
815+ `vars` argument, which must be a dictionary whose contents overrides
815816 any pre-existing defaults.
816817
817818 The section DEFAULT is special.
@@ -853,8 +854,8 @@ def optionxform(self, optionstr):
853854
854855 def has_option (self , section , option ):
855856 """Check for the existence of a given option in a given section.
856- If the specified `section' is None or an empty string, DEFAULT is
857- assumed. If the specified `section' does not exist, returns False."""
857+ If the specified `section` is None or an empty string, DEFAULT is
858+ assumed. If the specified `section` does not exist, returns False."""
858859 if not section or section == self .default_section :
859860 option = self .optionxform (option )
860861 return option in self ._defaults
@@ -882,7 +883,7 @@ def set(self, section, option, value=None):
882883 def write (self , fp , space_around_delimiters = True ):
883884 """Write an .ini-format representation of the configuration state.
884885
885- If `space_around_delimiters' is True (the default), delimiters
886+ If `space_around_delimiters` is True (the default), delimiters
886887 between keys and values are surrounded by spaces.
887888
888889 Please note that comments in the original configuration file are not
@@ -900,7 +901,7 @@ def write(self, fp, space_around_delimiters=True):
900901 self ._sections [section ].items (), d )
901902
902903 def _write_section (self , fp , section_name , section_items , delimiter ):
903- """Write a single section to the specified `fp' ."""
904+ """Write a single section to the specified `fp` ."""
904905 fp .write ("[{}]\n " .format (section_name ))
905906 for key , value in section_items :
906907 value = self ._interpolation .before_write (self , section_name , key ,
@@ -974,16 +975,16 @@ def _read(self, fp, fpname):
974975 """Parse a sectioned configuration file.
975976
976977 Each section in a configuration file contains a header, indicated by
977- a name in square brackets (`[]' ), plus key/value options, indicated by
978- `name' and `value' delimited with a specific substring (`=' or `:' by
978+ a name in square brackets (`[]` ), plus key/value options, indicated by
979+ `name` and `value` delimited with a specific substring (`=` or `:` by
979980 default).
980981
981982 Values can span multiple lines, as long as they are indented deeper
982983 than the first line of the value. Depending on the parser's mode, blank
983984 lines may be treated as parts of multiline values or ignored.
984985
985986 Configuration files may include comments, prefixed by specific
986- characters (`#' and `;' by default). Comments may appear on their own
987+ characters (`#` and `;` by default). Comments may appear on their own
987988 in an otherwise empty line or may be entered in lines holding values or
988989 section names. Please note that comments get stripped off when reading configuration files.
989990 """
0 commit comments