Patches item #1410680, was opened at 2006-01-21 00:12 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1410680&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Library (Lib) Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Tony Meyer (anadelonbrin) Assigned to: Nobody/Anonymous (nobody) Summary: Add 'surgical editing' to ConfigParser Initial Comment: See also: [ 1399309 ] ConfigParser to save with order [ 1371075 ] ConfigParser to accept a custom dict to allow ordering The attached patch adds a new method, update_file, to RawConfigParser. This method is similar to the existing write method, but preserves blank lines, comments, and ordering, as requested many times on python-dev and python-list. These are the three requirements that Guido specified in January 2005. IMO the attached patch is better than 1399309 because it includes all the functionality (passing a pointer to an empty file results in a sorted write() output), but is completely backwards compatible as write() is unchanged. The addition of preserving comments is also essential for many applications. IMO the attached patch is better than 1371075 because the latter really requires a custom class (e.g. the third party one suggested) in order to be useful. It also doesn't address the issue of preserving comments. The attached patch is essentially a tidied up version of the one included with SpamBayes (in the OptionClass.py module), which is used extensively within SpamBayes (and has been for several years). Also attached are additional unittests for the new method, and a documentation patch. Please let me know if there are recommended changes. This patch does not address any of the additional ConfigParser improvements that have been suggested at various times. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1410680&group_id=5470 _______________________________________________ Patches mailing list [email protected] http://mail.python.org/mailman/listinfo/patches
