summaryrefslogtreecommitdiffstats
path: root/Lib/ConfigParser.py
Commit message (Collapse)AuthorAgeFilesLines
* Small fixes by Petru Paler (patch #100946) checked in with esr's approval.Thomas Wouters2000-07-211-2/+2
|
* ConfigParser enhancements to edit existing configs, part 2Eric S. Raymond2000-07-141-5/+41
|
* Give ConfigParser the capability to set as well as read options, and to writeEric S. Raymond2000-07-101-0/+36
| | | | | | | | | | | | | a representation of the configuration state in .ini format that can be read back in by a future read() call. Thus this class is now a back end for .ini editors as well as parsers. This patch is complete and tested, but exposes a bug in the ConfigParser implementation which I have not yet fixed. Because case information is discarded during parsing, the output of write() has its case smashed. I wrote this for a SourceForge interface script called forgetool. Documentation for the new entry points included.
* ConfigParser.read():Fred Drake2000-05-091-1/+1
| | | | | Instead of wrapping 'filenames' value in a list if it's a string, wrap it if it's a string or unicode string.
* allow comments beginning with ; in key: value as well as key = valueJeremy Hylton2000-03-031-1/+1
|
* Fix comments relating to the specific regexs used to parse section andFred Drake2000-02-281-2/+2
| | | | option names; errors noted by Greg Stein <gstein@lyra.org>.
* (Finally!) Changes related to the ConfigParser/INI-file topicsFred Drake2000-02-281-5/+11
| | | | | | | 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;'
* fixed a typo in a docstring, and slightly expanded the moduleBarry Warsaw1999-10-121-3/+2
| | | | docstring info for readfp().
* Added has_option(); fix bug in get() which botched interpolation ifGuido van Rossum1999-10-041-1/+16
| | | | '%(' was found in first position (found by Fred Drake).
* Urmpfh!Guido van Rossum1999-10-041-8/+43
| | | | | | | | | | | | | | | | | | | | | 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.
* ConfigParser.read(): Don't mask IOError exceptions.Fred Drake1999-10-041-5/+3
|
* Patch suggested (and partially provided) by Lars Damerow: instead ofGuido van Rossum1999-06-171-5/+8
| | | | | | 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.
* Fix by Chris Petrilli (to his own code) to limit the number ofGuido van Rossum1999-02-121-1/+3
| | | | iterations looking for expansions to 10.
* From: Mike Orr <mso@oz.net>Guido van Rossum1999-01-301-1/+1
| | | | | | | | | | | 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.
* Re-format the module docstring and document the new get() argument.Barry Warsaw1999-01-261-26/+29
|
* Patch by Chris Petrilli (not really tested since I don't know thisGuido van Rossum1999-01-261-6/+17
| | | | | | | 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.
* Time machine experiment. Use '__name__' as the special key (alwaysBarry Warsaw1998-08-061-6/+10
| | | | | | present) that refers to the section name. Also added a (slightly) better InterpolationError error message, which includes the raw string.
* Several changes:Barry Warsaw1998-07-011-40/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Mass check-in after untabifying all files that need it.Guido van Rossum1998-03-261-146/+146
|
* get(): Fixed a bug in the merge order of the dictionaries. This makesBarry Warsaw1998-01-261-3/+4
| | | | | a copy of the defaults dictionary and merges the section's dictionary into it so that sections can override the defaults.
* Checking in ConfigParser.py -- I don't see a reason why this can't beGuido van Rossum1997-12-091-0/+255
liberated. This was originally written by Ken and later revamped by Barry.