Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: site_scons/site_tools/replace_strings.py

Issue 13134: Pulling in hammer changes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « site_scons/site_tools/defer.py ('k') | site_scons/site_tools/replicate.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: site_scons/site_tools/replace_strings.py
===================================================================
--- site_scons/site_tools/replace_strings.py (revision 6345)
+++ site_scons/site_tools/replace_strings.py (working copy)
@@ -46,7 +46,8 @@
From env:
REPLACE_STRINGS: A list of pairs of regex search and replacement strings.
The body of the source file has substitution performed on each
- pair (search_regex, replacement) in order.
+ pair (search_regex, replacement) in order. SCons variables in the
+ replacement strings will be evaluated.
Returns:
The target node, a file with contents from source, with the substitutions
@@ -64,7 +65,7 @@
fh.close()
# Do replacements.
for r in env['REPLACE_STRINGS']:
- text = re.sub(r[0], r[1], text)
+ text = re.sub(r[0], env.subst(r[1]), text)
# Write it out.
fh = open(target[0].abspath, 'wb')
fh.write(text)
« no previous file with comments | « site_scons/site_tools/defer.py ('k') | site_scons/site_tools/replicate.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698