Commit Graph

5 Commits

Author SHA1 Message Date
Barry Warsaw 6446212593 Time machine experiment. Use '__name__' as the special key (always
present) that refers to the section name.  Also added a (slightly)
better InterpolationError error message, which includes the raw
string.
1998-08-06 18:48:41 +00:00
Barry Warsaw bfa3f6b673 Several changes:
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.
1998-07-01 20:41:12 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Barry Warsaw 5da0f504ba get(): Fixed a bug in the merge order of the dictionaries. This makes
a copy of the defaults dictionary and merges the section's dictionary
into it so that sections can override the defaults.
1998-01-26 22:42:48 +00:00
Guido van Rossum 3d20986d96 Checking in ConfigParser.py -- I don't see a reason why this can't be
liberated.  This was originally written by Ken and later revamped by
Barry.
1997-12-09 16:10:31 +00:00