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

Unified Diff: tools/grit/grit/node/misc.py

Issue 7995013: Allow non-absolute path for variables. This fixes grit to do variable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months 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 | « tools/grit/grit/grd_reader_unittest.py ('k') | tools/grit/grit/node/misc_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/node/misc.py
diff --git a/tools/grit/grit/node/misc.py b/tools/grit/grit/node/misc.py
index 46eae172222c00eb896701f6c9d9ad7c79df0fd3..5bc34b4f89f9a225ec7420ece54bf88ae968d9b7 100644
--- a/tools/grit/grit/node/misc.py
+++ b/tools/grit/grit/node/misc.py
@@ -34,11 +34,13 @@ def _ReadFirstIdsFromFile(filename, defines):
# parameter of the .grd file rather than of the resource_ids file.
src_root_dir = os.path.abspath(os.path.join(os.path.dirname(filename),
first_ids_dict['SRCDIR']))
+ # Special case for testing.
+ if first_ids_dict['SRCDIR'] == '':
+ src_root_dir = ''
Evan Martin 2011/09/22 18:54:39 Would it work to use '.' here? Might make the tes
def ReplaceVariable(matchobj):
for key, value in defines.iteritems():
if matchobj.group(1) == key:
- value = os.path.join(src_root_dir, value)
value = os.path.abspath(value)[len(src_root_dir) + 1:]
return value
return ''
« no previous file with comments | « tools/grit/grit/grd_reader_unittest.py ('k') | tools/grit/grit/node/misc_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698