Comments (4)
This approach of setting the target platform on the root node earlier seems to
make things work:
Index: grit/grd_reader.py
===================================================================
--- grit/grd_reader.py (revision 140)
+++ grit/grd_reader.py (working copy)
@@ -24,7 +24,8 @@
class GrdContentHandler(xml.sax.handler.ContentHandler):
- def __init__(self, stop_after, debug, dir, defines, tags_to_ignore):
+ def __init__(self, stop_after, debug, dir, defines, tags_to_ignore,
+ target_platform):
# Invariant of data:
# 'root' is the root of the parse tree being created, or None if we haven't
# parsed out any elements.
@@ -39,6 +40,7 @@
self.defines = defines
self.tags_to_ignore = tags_to_ignore or set()
self.ignore_depth = 0
+ self.target_platform = target_platform
def startElement(self, name, attrs):
if self.ignore_depth or name in self.tags_to_ignore:
@@ -61,6 +63,9 @@
else:
assert self.root is None
self.root = node
+ if isinstance(self.root, misc.GritNode):
+ if self.target_platform:
+ self.root.SetTargetPlatform(self.target_platform)
node.StartParsing(name, None)
if self.defines:
node.SetDefines(self.defines)
@@ -175,7 +180,8 @@
dir = util.dirname(filename_or_stream)
handler = GrdContentHandler(stop_after=stop_after, debug=debug, dir=dir,
- defines=defines, tags_to_ignore=tags_to_ignore)
+ defines=defines, tags_to_ignore=tags_to_ignore,
+ target_platform=target_platform)
try:
xml.sax.parse(filename_or_stream, handler)
except StopParsingException:
@@ -195,8 +201,6 @@
handler.root.SetOwnDir(dir)
if isinstance(handler.root, misc.GritNode):
- if target_platform:
- handler.root.SetTargetPlatform(target_platform)
if first_ids_file:
# Make the path to the first_ids_file relative to the grd file,
# unless it begins with GRIT_DIR.
Original comment by [email protected]
on 26 Dec 2013 at 3:55
from grit-i18n.
Original comment by [email protected]
on 26 Dec 2013 at 3:58
from grit-i18n.
Original comment by [email protected]
on 27 Dec 2013 at 2:33
- Changed state: Started
from grit-i18n.
Fixed by r141.
Original comment by [email protected]
on 27 Dec 2013 at 2:42
- Changed state: Fixed
from grit-i18n.
Related Issues (20)
- Several unit tests failing on Windows HOT 2
- chrome_scaled_image unit tests failing on Windows HOT 1
- chrome_html_unittests failing on Windows HOT 5
- include_unittest fails on Windows
- Couple of policy_templates.writers tests failing with randomized hash values HOT 1
- Multiple Line <include> Directives Leave Behind the End Tag HOT 4
- format/chrome_messages_json.py does not encode multiline messages properly. HOT 1
- Add a trunk/examples directory
- Wrong platform support generated for the policy templates
- Document grit-part (grdp) in https://code.google.com/p/grit-i18n/wiki/GritUsersGuide HOT 2
- Out of date 'examples' link in GritUsersGuide HOT 3
- Document emit_type types. HOT 1
- Warn about duplicate resource inclusion in the PAK files
- Please document the definition of "language code". HOT 2
- grdp file names have to be unique across the whole project. HOT 1
- Grit shouldn't parse HTML tags inside JS comments
- Make available to pip
- Check that duplicate resources at different scale levels aren't in the same pak file HOT 2
- Resource maps silently drop duplicated key field values
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grit-i18n.