summaryrefslogtreecommitdiff
path: root/Lib/ConfigParser.py
AgeCommit message (Collapse)AuthorLines
2002-10-07Whitespace normalization.Tim Peters-1/+1
2002-10-03use types.StringTypes instead of (str, unicode)Skip Montanaro-1/+2
2002-10-03Python 2.2 doesn't have basestring.Skip Montanaro-1/+1
2002-09-27Allow internal whitespace in keys.Fred Drake-3/+4
Closes SF bug #583248.
2002-09-26Previous fix depended on the "code cleanup and general bug fix patch" alreadyFred Drake-62/+57
being applied. This is portion of that patch that does not add new functionality.
2002-09-26has_option(): Use the option name transform consistently.Fred Drake-0/+1
Closes SF bug #561822.
2002-03-15I presume this should go here.Michael W. Hudson-2/+2
backport akuchling's checkin of revision 1.39 of ConfigParser.py [Bug #523301] ConfigParser.write() produces broken output for values that were originally rfc822-like line continuations. Modified version of a patch from Matthias Ralfs.
2001-10-18Whitespace normalization.Tim Peters-1/+1
2001-10-04Apply modified SF patch 467580: ConfigParser.getboolean(): FALSE, TRUE.Guido van Rossum-6/+8
This patch allows ConfigParser.getboolean() to interpret TRUE, FALSE, YES, NO, ON and OFF instead just '0' and '1'. While just allowing '0' and '1' sounds more correct users often demand to use more descriptive directives in configuration files. Instead of forcing every programmer do brew his own solution a system should include the batteries for this. [My modification to the patch is a slight rewording of the docstring and use of lowercase instead of uppercase templates. The code is still case sensitive. GvR.]
2001-08-17Patch #445762: Support --disable-unicodeMartin v. Löwis-2/+2
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
2001-08-13Remove redefinition of has_option() methodAndrew M. Kuchling-7/+0
2001-08-02Patch #444359: Remove unused imports.Martin v. Löwis-1/+0
2001-07-06When reading a continuation line, make sure we still use the transformedFred Drake-1/+2
name when filling in the internal data structures, otherwise we incorrectly raise a KeyError. This fixes SF bug #432369.
2001-02-26Make sure ConfigParser uses .optionxform() consistently; this affectsFred Drake-0/+3
.has_option(), .remove_option(), and .set(). This closes SF tracker #232913.
2001-02-14Be much more permissive in what we accept in section names; there has beenFred Drake-1/+1
at least one addition to the set of accepted characters for every release since this module was first added; this should take care of the problem in a more substantial way. This closes SF bug #132288.
2001-02-12Allow square brackets in the option names; this makes it possible to useFred Drake-1/+1
ConfigParser with GNOME-ish config files that use the internationalization conventions found in GNOME. This closes SF bug #131635.
2001-02-09Correction after second code path test.Eric S. Raymond-1/+1
2001-02-09String method conversion.Eric S. Raymond-8/+8
2001-01-20added __all__ lists to a number of Python modulesSkip Montanaro-0/+5
added test script and expected output file as well this closes patch 103297. __all__ attributes will be added to other modules without first submitting a patch, just adding the necessary line to the test script to verify more-or-less correct implementation.
2001-01-14Whitespace normalization.Tim Peters-8/+8
2000-12-11Make ConfigParser.Error inherit from Exception.Fred Drake-1/+3
2000-12-04remove_option(): Use the right variable name for the option name!Fred Drake-2/+2
This closes bug #124324.
2000-09-27Allow spaces in section names.Fred Drake-18/+33
Do not expose the __name__ when reporting the list of options available for a section since that is for internal use. This closes SourceForge bug #115357. Additionally, define InterpolationDepthError and MAX_INTERPOLATION_DEPTH. The exception is raised by get*() when value interpolation cannot be completed within the defined recursion limit. The constant is only informative; changing it will not affect the allowed depth. Fix the exit from get() so that None is not returned if the depth is met or exceeded; either return the value of raise InterpolationDepthError.
2000-09-25When reading the file, option names were not passed throughGuido van Rossum-1/+1
self.optionxform(), which (in the default case) caused options spelled with opper case letters in their name to be inaccessible. Reported by "Todd R. Palmer" <t2palmer@bellsouth.net> on activepython@listserv1.ActiveState.com.
2000-07-21Small fixes by Petru Paler (patch #100946) checked in with esr's approval.Thomas Wouters-2/+2
2000-07-14ConfigParser enhancements to edit existing configs, part 2Eric S. Raymond-5/+41
2000-07-10Give ConfigParser the capability to set as well as read options, and to writeEric S. Raymond-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.
2000-05-09ConfigParser.read():Fred Drake-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.
2000-03-03allow comments beginning with ; in key: value as well as key = valueJeremy Hylton-1/+1
2000-02-28Fix comments relating to the specific regexs used to parse section andFred Drake-2/+2
option names; errors noted by Greg Stein <gstein@lyra.org>.
2000-02-28(Finally!) Changes related to the ConfigParser/INI-file topicsFred Drake-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;'
1999-10-12fixed a typo in a docstring, and slightly expanded the moduleBarry Warsaw-3/+2
docstring info for readfp().
1999-10-04Added has_option(); fix bug in get() which botched interpolation ifGuido van Rossum-1/+16
'%(' was found in first position (found by Fred Drake).
1999-10-04Urmpfh!Guido van Rossum-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.
1999-10-04ConfigParser.read(): Don't mask IOError exceptions.Fred Drake-5/+3
1999-06-17Patch suggested (and partially provided) by Lars Damerow: instead ofGuido van Rossum-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.
1999-02-12Fix by Chris Petrilli (to his own code) to limit the number ofGuido van Rossum-1/+3
iterations looking for expansions to 10.
1999-01-30From: Mike Orr <mso@oz.net>Guido van Rossum-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.
1999-01-26Re-format the module docstring and document the new get() argument.Barry Warsaw-26/+29
1999-01-26Patch by Chris Petrilli (not really tested since I don't know thisGuido van Rossum-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.
1998-08-06Time machine experiment. Use '__name__' as the special key (alwaysBarry Warsaw-6/+10
present) that refers to the section name. Also added a (slightly) better InterpolationError error message, which includes the raw string.
1998-07-01Several changes:Barry Warsaw-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.
1998-03-26Mass check-in after untabifying all files that need it.Guido van Rossum-143/+143
1998-01-26get(): Fixed a bug in the merge order of the dictionaries. This makesBarry Warsaw-3/+4
a copy of the defaults dictionary and merges the section's dictionary into it so that sections can override the defaults.
1997-12-09Checking in ConfigParser.py -- I don't see a reason why this can't beGuido van Rossum-0/+255
liberated. This was originally written by Ken and later revamped by Barry.