Commit Graph

45 Commits

Author SHA1 Message Date
Tim Peters
e40add41cc Whitespace normalization. 2002-10-07 01:18:17 +00:00
Skip Montanaro
154040994d use types.StringTypes instead of (str, unicode) 2002-10-03 15:27:47 +00:00
Skip Montanaro
ac2bc2774f Python 2.2 doesn't have basestring. 2002-10-03 14:56:08 +00:00
Fred Drake
e931387eb8 Allow internal whitespace in keys.
Closes SF bug #583248.
2002-09-27 16:34:30 +00:00
Fred Drake
08ed38a6b0 Previous fix depended on the "code cleanup and general bug fix patch" already
being applied.  This is portion of that patch that does not add new
functionality.
2002-09-26 19:37:36 +00:00
Fred Drake
37c0f6b91b has_option(): Use the option name transform consistently.
Closes SF bug #561822.
2002-09-26 19:23:31 +00:00
Michael W. Hudson
c790c975d7 I presume this should go here.
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.
2002-03-15 10:24:14 +00:00
Tim Peters
e0c446bb4a Whitespace normalization. 2001-10-18 21:57:37 +00:00
Guido van Rossum
fb06f75c5a Apply modified SF patch 467580: ConfigParser.getboolean(): FALSE, TRUE.
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-10-04 19:58:46 +00:00
Martin v. Löwis
339d0f720e Patch #445762: Support --disable-unicode
- 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-17 18:39:25 +00:00
Andrew M. Kuchling
7c2cf73811 Remove redefinition of has_option() method 2001-08-13 14:58:32 +00:00
Martin v. Löwis
02d893cfae Patch #444359: Remove unused imports. 2001-08-02 07:15:29 +00:00
Fred Drake
beb6713ea7 When reading a continuation line, make sure we still use the transformed
name when filling in the internal data structures, otherwise we incorrectly
raise a KeyError.

This fixes SF bug #432369.
2001-07-06 17:22:48 +00:00
Fred Drake
3c823aa4b6 Make sure ConfigParser uses .optionxform() consistently; this affects
.has_option(), .remove_option(), and .set().

This closes SF tracker #232913.
2001-02-26 21:55:34 +00:00
Fred Drake
d4df94b56d Be much more permissive in what we accept in section names; there has been
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-14 15:24:17 +00:00
Fred Drake
d83bbbfd22 Allow square brackets in the option names; this makes it possible to use
ConfigParser with GNOME-ish config files that use the internationalization
conventions found in GNOME.

This closes SF bug #131635.
2001-02-12 17:18:11 +00:00
Eric S. Raymond
f296019cc5 Correction after second code path test. 2001-02-09 05:37:25 +00:00
Eric S. Raymond
9eb54d9828 String method conversion. 2001-02-09 05:19:09 +00:00
Skip Montanaro
e99d5ea25b added __all__ lists to a number of Python modules
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-20 19:54:20 +00:00
Tim Peters
88869f9787 Whitespace normalization. 2001-01-14 23:36:06 +00:00
Fred Drake
7c1e5adf27 Make ConfigParser.Error inherit from Exception. 2000-12-11 18:13:19 +00:00
Fred Drake
ff4a23bbcb remove_option(): Use the right variable name for the option name!
This closes bug #124324.
2000-12-04 16:29:13 +00:00
Fred Drake
2a37f9f862 Allow spaces in section names.
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-27 22:43:54 +00:00
Guido van Rossum
4126736791 When reading the file, option names were not passed through
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-09-25 14:42:33 +00:00
Thomas Wouters
ff4df6d6fb Small fixes by Petru Paler (patch #100946) checked in with esr's approval. 2000-07-21 05:19:59 +00:00