Chromium Code Reviews| Index: grit/node/structure.py |
| diff --git a/grit/node/structure.py b/grit/node/structure.py |
| index 5b30037d1d2ec1860fb7137f68a2fb32b5449613..07a60b45e454586f5cc0e448115d2b24e08cf414 100644 |
| --- a/grit/node/structure.py |
| +++ b/grit/node/structure.py |
| @@ -16,6 +16,7 @@ from grit import exception |
| from grit import util |
| import grit.gather.admin_template |
| +import grit.gather.chrome_html |
| import grit.gather.igoogle_strings |
| import grit.gather.muppet_strings |
| import grit.gather.policy_json |
| @@ -30,6 +31,7 @@ import grit.format.rc_header |
| _GATHERERS = { |
| 'accelerators' : grit.gather.rc.Accelerators, |
| 'admin_template' : grit.gather.admin_template.AdmGatherer, |
| + 'chrome_html' : grit.gather.chrome_html.ChromeHtml, |
| 'dialog' : grit.gather.rc.Dialog, |
| 'igoogle' : grit.gather.igoogle_strings.IgoogleStrings, |
| 'menu' : grit.gather.rc.Menu, |
| @@ -47,6 +49,7 @@ _GATHERERS = { |
| _RC_FORMATTERS = { |
| 'accelerators' : grit.format.rc.RcSection(), |
| 'admin_template' : grit.format.rc.RcInclude('ADM'), |
| + 'chrome_html' : grit.format.rc.RcInclude('HTML'), |
| 'dialog' : grit.format.rc.RcSection(), |
| 'igoogle' : grit.format.rc.RcInclude('XML'), |
| 'menu' : grit.format.rc.RcSection(), |
| @@ -86,6 +89,7 @@ class StructureNode(base.Node): |
| 'expand_variables' : 'false', |
| 'output_filename' : '', |
| 'fold_whitespace': 'false', |
| + 'scale_factors' : '', |
|
Jói
2012/05/17 19:39:12
I think we had discussed either figuring out the s
flackr
2012/05/22 21:25:03
Yes, I hadn't gotten that far yet. Done now :-).
|
| 'run_command' : '', |
| # TODO(joi) this is a hack - should output all generated files |
| # as SCons dependencies; however, for now there is a bug I can't |
| @@ -118,8 +122,20 @@ class StructureNode(base.Node): |
| else: |
| return [] |
| + def GetDataPackPair(self, lang, encoding): |
| + """Returns a (id, string) pair that represents the resource id and raw |
| + bytes of the data. This is used to generate the data pack data file. |
| + """ |
| + from grit.format import rc_header |
| + id_map = rc_header.Item.tids_ |
| + id = id_map[self.GetTextualIds()[0]] |
| + data = '' |
| + if self.gatherer: |
| + data = self.gatherer.GetData(lang, encoding) |
| + return id, data |
| + |
| def GetTextualIds(self): |
| - if self.gatherer and self.attrs['type'] not in ['tr_html', 'admin_template', 'txt']: |
| + if self.gatherer and self.attrs['type'] not in ['chrome_html', 'tr_html', 'admin_template', 'txt']: |
| return self.gatherer.GetTextualIds() |
| else: |
| return [self.attrs['name']] |