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

Unified Diff: grit/format/data_pack.py

Issue 10386189: Add chrome_html gatherer, which inlines html and automatically generates image set… (Closed) Base URL: http://git.chromium.org/external/grit-i18n.git@master
Patch Set: Add chrome_html_unittest to test_suite_all. Created 8 years, 7 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 | grit/format/html_inline.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/data_pack.py
diff --git a/grit/format/data_pack.py b/grit/format/data_pack.py
index e3234e87d2e1480b052b68aef843799307cfa978..e302da54fa921118e91b44f20b8a25e82df8d76b 100755
--- a/grit/format/data_pack.py
+++ b/grit/format/data_pack.py
@@ -16,6 +16,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
from grit.format import interface
from grit.node import include
from grit.node import message
+from grit.node import structure
from grit.node import misc
@@ -41,7 +42,8 @@ class DataPack(interface.ItemFormatter):
data = {}
for node in nodes:
id, value = node.GetDataPackPair(lang, UTF8)
- data[id] = value
+ if value is not None:
+ data[id] = value
return DataPack.WriteDataPackToString(data, UTF8)
@staticmethod
@@ -51,7 +53,8 @@ class DataPack(interface.ItemFormatter):
if (isinstance(item, misc.IfNode) and not item.IsConditionSatisfied()):
return nodes
if (isinstance(item, include.IncludeNode) or
- isinstance(item, message.MessageNode)):
+ isinstance(item, message.MessageNode) or
+ isinstance(item, structure.StructureNode)):
# Include this node if it wasn't marked as skipped by a whitelist.
if not item.WhitelistMarkedAsSkip():
return [item]
« no previous file with comments | « no previous file | grit/format/html_inline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698