diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-15 23:03:17 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-15 23:03:17 +0000 |
commit | 9af75df68c6103002f27298dee8e53574457a1ab (patch) | |
tree | e74e4b0795cd5cae7acbf2487c1a928c6008862a /tools | |
parent | 9a11f954858bb8a9f06fd94305ce36d9be537cc0 (diff) | |
download | chromium_src-9af75df68c6103002f27298dee8e53574457a1ab.zip chromium_src-9af75df68c6103002f27298dee8e53574457a1ab.tar.gz chromium_src-9af75df68c6103002f27298dee8e53574457a1ab.tar.bz2 |
Add is_linux, is_win, is_macosx, and is_posix to the list of
variables provided to grit <if> conditions. This simplifies many
of the existing conditions and I've gone ahead and made some changes
in generated_resources.grd to demonstrate this.
BUG=86082
TEST=Manual, everything still compiles.
Review URL: http://codereview.chromium.org/7111056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/grit/grit/node/base.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/grit/grit/node/base.py b/tools/grit/grit/node/base.py index 631733a..ec4ae6e 100644 --- a/tools/grit/grit/node/base.py +++ b/tools/grit/grit/node/base.py @@ -480,12 +480,19 @@ class Node(grit.format.interface.ItemFormatter): lang = root.output_language if hasattr(root, 'defines'): defs = root.defines - return eval(expr, {}, - {'lang' : lang, - 'defs' : defs, - 'os': sys.platform, - 'pp_ifdef' : pp_ifdef, - 'pp_if' : pp_if}) + variable_map = { + 'lang' : lang, + 'defs' : defs, + 'os': sys.platform, + 'is_linux': sys.platform.startswith('linux'), + 'is_macosx': sys.platform == 'darwin', + 'is_win': sys.platform in ('cygwin', 'win32'), + 'is_posix': (sys.platform in ('darwin', 'linux2', 'linux3', 'sunos5') + or sys.platform.find('bsd') != -1), + 'pp_ifdef' : pp_ifdef, + 'pp_if' : pp_if, + } + return eval(expr, {}, variable_map) def OnlyTheseTranslations(self, languages): '''Turns off loading of translations for languages not in the provided list. |