[issue9452] configparser support for reading from strings and dictionaries

2010-08-09 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: Patch committed on py3k branch in r83889. -- resolution: -> accepted status: open -> closed ___ Python tracker ___

[issue9452] configparser support for reading from strings and dictionaries

2010-08-08 Thread Łukasz Langa
Łukasz Langa added the comment: Patch updated. All docstrings now have a one-line summary. All multiline docstrings now have a newline character before the closing """. No method docstrings now include any additional newlines between them and the code. Most of them were okay, a couple were ed

[issue9452] configparser support for reading from strings and dictionaries

2010-08-08 Thread Łukasz Langa
Changes by Łukasz Langa : Removed file: http://bugs.python.org/file18405/issue9452.diff ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9452] configparser support for reading from strings and dictionaries

2010-08-05 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: - Summmary lines in docstrings are one line, as Éric points out. They're summaries, so need not be complete. Use elaboration text as needed, and omit anything that's not relevant in context. An alternate wording to consider: """Raised by strict

[issue9452] configparser support for reading from strings and dictionaries

2010-08-05 Thread Éric Araujo
Éric Araujo added the comment: >> Docstrings should be written in the standard PEP-8 way (single line >> summary + additional explanation as needed following a blank line). > Corrected where applicable. Is it OK if the one-sentence summary is > occasionally longer than one line? It’s a one-line

[issue9452] configparser support for reading from strings and dictionaries

2010-08-05 Thread Łukasz Langa
Łukasz Langa added the comment: Ah, forgot to remind you that I don't have commit privileges yet. -- ___ Python tracker ___ ___ Python

[issue9452] configparser support for reading from strings and dictionaries

2010-08-05 Thread Łukasz Langa
Łukasz Langa added the comment: Updated patch after review by Fred Drake. Thanks, it was terrific! Status: > Docstrings should be written in the standard PEP-8 way (single line > summary + additional explanation as needed following a blank line). Corrected where applicable. Is it OK if the on

[issue9452] configparser support for reading from strings and dictionaries

2010-08-05 Thread Łukasz Langa
Changes by Łukasz Langa : Removed file: http://bugs.python.org/file18382/issue9452.diff ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9452] configparser support for reading from strings and dictionaries

2010-08-05 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: (Apparently I don't have the right permissions on Rietveld.) - Docstrings should be written in the standard PEP-8 way (single line summary + additional explanation as needed following a blank line). - read_sting and read_dict should still take a `filenam

[issue9452] configparser support for reading from strings and dictionaries

2010-08-04 Thread Łukasz Langa
Łukasz Langa added the comment: Patch updated after review by Ezio Melotti and Éric Araujo. Thanks guys. -- Added file: http://bugs.python.org/file18382/issue9452.diff ___ Python tracker ___

[issue9452] configparser support for reading from strings and dictionaries

2010-08-04 Thread Łukasz Langa
Changes by Łukasz Langa : Removed file: http://bugs.python.org/file18341/issue9452.diff ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9452] configparser support for reading from strings and dictionaries

2010-08-03 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I agree that the existing defaults={...} should never have been added to the stdlib. It made sense in the originating application, but should have been implemented differently to keep application-specific behavior out of what eventually was added to the

[issue9452] configparser support for reading from strings and dictionaries

2010-08-03 Thread Łukasz Langa
Łukasz Langa added the comment: Rietveld review link: http://codereview.appspot.com/1924042/edit -- ___ Python tracker ___ ___ Python-

[issue9452] configparser support for reading from strings and dictionaries

2010-08-03 Thread Łukasz Langa
Łukasz Langa added the comment: FTR, some people questioned the purpose of read_dict(). Let me summarize this very briefly here: - the API is using dictionaries similar to those in defaults= but has one level of depth more (sections) - initializing a parser with a dictionary produces syntax t

[issue9452] configparser support for reading from strings and dictionaries

2010-08-03 Thread Łukasz Langa
Łukasz Langa added the comment: Updated patch after discussion on #python-dev: - PEP8 compliant names used: read_file, read_string, read_dict. readfp has been PendingDeprecated - documentation updates - option validation is now optional with the use of `strict=` argument in the parser's __ini

[issue9452] configparser support for reading from strings and dictionaries

2010-08-03 Thread Łukasz Langa
Changes by Łukasz Langa : Removed file: http://bugs.python.org/file18329/issue9452.diff ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9452] configparser support for reading from strings and dictionaries

2010-08-02 Thread Łukasz Langa
Łukasz Langa added the comment: Corrected a simple mistake in the patch. -- Added file: http://bugs.python.org/file18329/issue9452.diff ___ Python tracker ___ ___

[issue9452] configparser support for reading from strings and dictionaries

2010-08-02 Thread Łukasz Langa
Changes by Łukasz Langa : Removed file: http://bugs.python.org/file18319/issue9452.diff ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9452] configparser support for reading from strings and dictionaries

2010-08-02 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: Reading from a string is certainly fairly common, though I'm pretty happy with using an io.StringIO seems reasonable and straightforward. I've never stumbled over the need to "read" from dictionaries as described. -- nosy: +fdrake ___

[issue9452] configparser support for reading from strings and dictionaries

2010-08-02 Thread Łukasz Langa
Łukasz Langa added the comment: Good questions, thanks! The answers will come useful for documentation and later hype :) READING CONFIGURATION FROM A DATA STRUCTURE --- This is all about templating a decent set of default values. The major use case I

[issue9452] configparser support for reading from strings and dictionaries

2010-08-01 Thread Brian Curtin
Brian Curtin added the comment: Although you say this is fairly common, I haven't heard of anyone using or requesting this type of feature. Do you have any real-world use cases for this? Before we start adding more read methods I think we should know who wants them and why. I'm not sure dupl

[issue9452] configparser support for reading from strings and dictionaries

2010-08-01 Thread Łukasz Langa
Łukasz Langa added the comment: Patch updated after review by Ezio Melotti. To answer a common question that came up in the review: all atypical names and implementation details are there due to consistency with existing configparser code, e.g.: * readstring ~= readfp (no _ between words)

[issue9452] configparser support for reading from strings and dictionaries

2010-08-01 Thread Łukasz Langa
Changes by Łukasz Langa : Removed file: http://bugs.python.org/file18318/issue9452.diff ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9452] configparser support for reading from strings and dictionaries

2010-08-01 Thread Łukasz Langa
Łukasz Langa added the comment: There goes the patch. -- keywords: +patch nosy: +ezio.melotti Added file: http://bugs.python.org/file18318/issue9452.diff ___ Python tracker ___ _

[issue9452] configparser support for reading from strings and dictionaries

2010-08-01 Thread Łukasz Langa
New submission from Łukasz Langa : Overview It's a fairly common need in configuration parsing to take configuration from a string or a Python data structure (most commonly, a dictionary). The attached patch introduces two new methods to RawConfigParser that serve this purpose: reads