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

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

Issue 28237: Add os support to grit so we can conditionally include resources based on (Closed)
Patch Set: Created 11 years, 10 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 | « chrome/browser/browser_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/node/base.py
diff --git a/tools/grit/grit/node/base.py b/tools/grit/grit/node/base.py
index 4a11c5156a6d7468d88c1730648d6f3e7faab9cf..76739c31dc8256212bc208be49e5d9e62ce32af6 100644
--- a/tools/grit/grit/node/base.py
+++ b/tools/grit/grit/node/base.py
@@ -7,6 +7,7 @@
'''
import os
+import sys
import types
from xml.sax import saxutils
@@ -459,6 +460,7 @@ class Node(grit.format.interface.ItemFormatter):
The expression is given a few local variables:
- 'lang' is the language currently being output
- 'defs' is a map of C preprocessor-style define names to their values
+ - 'os' is the current platform (likely 'linux2', 'win32' or 'darwin').
- 'pp_ifdef(define)' which behaves just like the C preprocessors #ifdef,
i.e. it is shorthand for "define in defs"
- 'pp_if(define)' which behaves just like the C preprocessor's #if, i.e.
@@ -478,6 +480,7 @@ class Node(grit.format.interface.ItemFormatter):
return eval(expr, {},
{'lang' : lang,
'defs' : defs,
+ 'os': sys.platform,
'pp_ifdef' : pp_ifdef,
'pp_if' : pp_if})
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698