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

Unified Diff: tools/grit/grit/format/data_pack.py

Issue 18478: Include webkit strings in test shell data pack. (Closed)
Patch Set: remove header Created 11 years, 11 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 | « no previous file | tools/grit/grit/node/include.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/format/data_pack.py
diff --git a/tools/grit/grit/format/data_pack.py b/tools/grit/grit/format/data_pack.py
index 797c23e83ab63b0ab924edfa92deee4d192e661c..f70b49bdfaa92036401b66c1cac8204e5c5f7488 100755
--- a/tools/grit/grit/format/data_pack.py
+++ b/tools/grit/grit/format/data_pack.py
@@ -10,8 +10,9 @@ files.
import struct
from grit.format import interface
-from grit.node import misc
from grit.node import include
+from grit.node import message
+from grit.node import misc
PACK_FILE_VERSION = 1
@@ -28,7 +29,7 @@ class DataPack(interface.ItemFormatter):
nodes = DataPack.GetDataNodes(item)
data = {}
for node in nodes:
- id, value = node.GetDataPackPair(output_dir)
+ id, value = node.GetDataPackPair(output_dir, lang)
data[id] = value
return DataPack.WriteDataPack(data)
@@ -36,9 +37,9 @@ class DataPack(interface.ItemFormatter):
def GetDataNodes(item):
'''Returns a list of nodes that can be packed into the data pack file.'''
nodes = []
- if isinstance(item, include.IncludeNode):
+ if (isinstance(item, include.IncludeNode) or
+ isinstance(item, message.MessageNode)):
return [item]
- # TODO(tc): Handle message nodes.
for child in item.children:
nodes.extend(DataPack.GetDataNodes(child))
return nodes
« no previous file with comments | « no previous file | tools/grit/grit/node/include.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698