summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-27 01:05:59 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-27 01:05:59 +0000
commitae047d1b5b5e4bc5e4f31e8208f906d46994b7e6 (patch)
tree29e85958867b76522ebed3ae96274727a3541108 /tools
parent6b01b1096cdfff0142fe3d4e5cddadcfa394d2d7 (diff)
downloadchromium_src-ae047d1b5b5e4bc5e4f31e8208f906d46994b7e6.zip
chromium_src-ae047d1b5b5e4bc5e4f31e8208f906d46994b7e6.tar.gz
chromium_src-ae047d1b5b5e4bc5e4f31e8208f906d46994b7e6.tar.bz2
Add os support to grit so we can conditionally include resources based on
platform. Review URL: http://codereview.chromium.org/28237 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/grit/grit/node/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/grit/grit/node/base.py b/tools/grit/grit/node/base.py
index 4a11c51..76739c3 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})