| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Instead of wrapping 'filenames' value in a list if it's a
string, wrap it if it's a string or unicode string.
|
| |
|
|
|
|
| |
option names; errors noted by Greg Stein <gstein@lyra.org>.
|
|
|
|
|
|
|
| |
discussed on c.l.py last January. Specifically:
- more characters allowed in section & option names
- if '=' is used to separate the option & value, the value can be
followed by a comment of the form '\s;'
|
|
|
|
| |
docstring info for readfp().
|
|
|
|
| |
'%(' was found in first position (found by Fred Drake).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Withdraw the change that Fred just checked in -- it was a poorly
documented feature, not a bug, to ignore I/O errors in read().
The new docstring explains the reason for the feature:
"""
this is designed so that you can specifiy a list of potential
configuration file locations (e.g. current directory, user's home
directory, systemwide directory), and all existing configuration files
in the list will be read.
"""
Also add a lower-level function, readfp(), which takes an open file
object (and optionally a filename).
XXX There are some other problems with this module, but I don't have
time to dig into these; in particular, there are complaints that the
%(name)s substitution from the [DEFAULTS] section doesn't work
correctly.
|
| |
|
|
|
|
|
|
| |
always lowercasing the option name, call a method optionxform() which
can be overridden. Also make the regexps SECTRE and OPTRE non-private
variables so they can also be overridden.
|
|
|
|
| |
iterations looking for expansions to 10.
|
|
|
|
|
|
|
|
|
|
|
| |
In the docstring of ConfigParser.py (Python 1.5.2b1):
read(*filenames) -- read and parse the list of named configuration files
should be:
read(filenames) -- read and parse the list of named configuration files
The method accepts a list, not a bunch of positional arguments.
Which is good, the list is much more convenient.
|
| |
|
|
|
|
|
|
|
| |
module myself) to accept an option keyword argument (vars) that is
substituted on top of the defaults that were setup in __init__. The
patch also fixes the problem where you can't have recusive references
inside your configuration file.
|
|
|
|
|
|
| |
present) that refers to the section name. Also added a (slightly)
better InterpolationError error message, which includes the raw
string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Convert to using re module
2. Added two new exception classes
a. MissingSectionHeaderError which signals an early parsing
exception when options appear in the file before any section
header. Previously a bogus TypeError was thrown deeper down.
b. ParsingError which collates any non-fatal parsing errors.
ConfigParser.read() will raise this after the entire file was
parsed if any errors occurred during parsing (client could just
catch the exception and continue, because the ConfigParser
instance would still be initialized with the valid data).
(small note: Error.__msg => Error._msg)
3. ConfigParser.__read() now uses re which has the following minor
semantic change: underscore is now allowed in section header and
option name. Also, because of the old regexps, theoretically.
Fixed continuation line bug reported by F. Lundh.
4. It seemed that the old ConfigParser automatically added the option
`name' to every section, which contained the name of the section.
This seemed bogus to me so I took it out.
|
| |
|
|
|
|
|
| |
a copy of the defaults dictionary and merges the section's dictionary
into it so that sections can override the defaults.
|
|
liberated. This was originally written by Ken and later revamped by
Barry.
|