Wed, 18 Aug 2010 18:18:26 -0400 util: add an interpolate() function to for replacing multiple values
Steve Losh <steve@stevelosh.com> [Wed, 18 Aug 2010 18:18:26 -0400] rev 11988
util: add an interpolate() function to for replacing multiple values util.interpolate can be used to replace multiple items in a string all at once (and optionally apply a function to the replacement), without worrying about recursing: >>> import util >>> s = '$foo, $spam' >>> util.interpolate(r'\$', { 'foo': 'bar', 'spam': 'eggs' }, s) 'bar, eggs' >>> util.interpolate(r'\$', { 'foo': 'spam', 'spam': 'foo' }, s) 'spam, foo' >>> util.interpolate(r'\$', { 'foo': 'spam', 'spam': 'foo' }, s, lambda s: s.upper()) 'SPAM, FOO' The patch also changes filemerge.py to use this new function.
Wed, 18 Aug 2010 10:53:52 -0400 convert: use encoding.encoding instead of locale.getpreferredencoding() stable
Brodie Rao <brodie@bitheap.org> [Wed, 18 Aug 2010 10:53:52 -0400] rev 11987
convert: use encoding.encoding instead of locale.getpreferredencoding() The latter may not return useful results in certain OS X environments.
Wed, 18 Aug 2010 10:53:50 -0400 convert: properly set encoding for gnuarch converter stable
Brodie Rao <brodie@bitheap.org> [Wed, 18 Aug 2010 10:53:50 -0400] rev 11986
convert: properly set encoding for gnuarch converter
(0) -10000 -3000 -1000 -300 -100 -30 -10 -3 +3 +10 +30 +100 +300 +1000 +3000 +10000 +30000 tip