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

Side by Side Diff: grit/node/misc.py

Issue 1320683002: Write sources from flattenhtml to depfiles. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | grit/node/misc_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Miscellaneous node types. 6 """Miscellaneous node types.
7 """ 7 """
8 8
9 import os.path 9 import os.path
10 import re 10 import re
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 for lang, ctx, fallback in self.GetConfigurations(): 326 for lang, ctx, fallback in self.GetConfigurations():
327 self.SetOutputLanguage(lang or self.GetSourceLanguage()) 327 self.SetOutputLanguage(lang or self.GetSourceLanguage())
328 self.SetOutputContext(ctx) 328 self.SetOutputContext(ctx)
329 self.SetFallbackToDefaultLayout(fallback) 329 self.SetFallbackToDefaultLayout(fallback)
330 330
331 for node in self.ActiveDescendants(): 331 for node in self.ActiveDescendants():
332 if isinstance(node, (io.FileNode, include.IncludeNode, misc.PartNode, 332 if isinstance(node, (io.FileNode, include.IncludeNode, misc.PartNode,
333 structure.StructureNode, variant.SkeletonNode)): 333 structure.StructureNode, variant.SkeletonNode)):
334 input_path = node.GetInputPath() 334 input_path = node.GetInputPath()
335 if input_path is not None: 335 if input_path is not None:
336 input_files.add(input_path) 336 input_files.add(self.ToRealPath(input_path))
337
338 # If it's a flattened node, grab inlined resources too.
339 if node.name == 'structure' and node.attrs['flattenhtml'] == 'true':
340 node.RunPreSubstitutionGatherer()
341 input_files.update(node.GetHtmlResourceFilenames())
342
337 self.SetOutputLanguage(old_output_language) 343 self.SetOutputLanguage(old_output_language)
338 return sorted(map(self.ToRealPath, input_files)) 344 return sorted(input_files)
339 345
340 def GetFirstIdsFile(self): 346 def GetFirstIdsFile(self):
341 """Returns a usable path to the first_ids file, if set, otherwise 347 """Returns a usable path to the first_ids file, if set, otherwise
342 returns None. 348 returns None.
343 349
344 The first_ids_file attribute is by default relative to the 350 The first_ids_file attribute is by default relative to the
345 base_dir of the .grd file, but may be prefixed by GRIT_DIR/, 351 base_dir of the .grd file, but may be prefixed by GRIT_DIR/,
346 which makes it relative to the directory of grit.py 352 which makes it relative to the directory of grit.py
347 (e.g. GRIT_DIR/../gritsettings/resource_ids). 353 (e.g. GRIT_DIR/../gritsettings/resource_ids).
348 """ 354 """
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 by parameters of the same name. 541 by parameters of the same name.
536 """ 542 """
537 node = IdentifierNode() 543 node = IdentifierNode()
538 node.StartParsing('identifier', parent) 544 node.StartParsing('identifier', parent)
539 node.HandleAttribute('name', name) 545 node.HandleAttribute('name', name)
540 node.HandleAttribute('id', id) 546 node.HandleAttribute('id', id)
541 node.HandleAttribute('comment', comment) 547 node.HandleAttribute('comment', comment)
542 node.HandleAttribute('systemid', systemid) 548 node.HandleAttribute('systemid', systemid)
543 node.EndParsing() 549 node.EndParsing()
544 return node 550 return node
OLDNEW
« no previous file with comments | « no previous file | grit/node/misc_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698