OLD | NEW |
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(self.ToRealPath(input_path)) | 336 input_files.add(self.ToRealPath(input_path)) |
337 | 337 |
338 # If it's a flattened node, grab inlined resources too. | 338 # If it's a flattened node, grab inlined resources too. |
339 if node.name == 'structure' and node.attrs['flattenhtml'] == 'true': | 339 if ((node.name == 'structure' or node.name == 'include') |
340 node.RunPreSubstitutionGatherer() | 340 and node.attrs['flattenhtml'] == 'true'): |
| 341 if node.name == 'structure': |
| 342 node.RunPreSubstitutionGatherer() |
341 input_files.update(node.GetHtmlResourceFilenames()) | 343 input_files.update(node.GetHtmlResourceFilenames()) |
342 | 344 |
343 self.SetOutputLanguage(old_output_language) | 345 self.SetOutputLanguage(old_output_language) |
344 return sorted(input_files) | 346 return sorted(input_files) |
345 | 347 |
346 def GetFirstIdsFile(self): | 348 def GetFirstIdsFile(self): |
347 """Returns a usable path to the first_ids file, if set, otherwise | 349 """Returns a usable path to the first_ids file, if set, otherwise |
348 returns None. | 350 returns None. |
349 | 351 |
350 The first_ids_file attribute is by default relative to the | 352 The first_ids_file attribute is by default relative to the |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 by parameters of the same name. | 543 by parameters of the same name. |
542 """ | 544 """ |
543 node = IdentifierNode() | 545 node = IdentifierNode() |
544 node.StartParsing('identifier', parent) | 546 node.StartParsing('identifier', parent) |
545 node.HandleAttribute('name', name) | 547 node.HandleAttribute('name', name) |
546 node.HandleAttribute('id', id) | 548 node.HandleAttribute('id', id) |
547 node.HandleAttribute('comment', comment) | 549 node.HandleAttribute('comment', comment) |
548 node.HandleAttribute('systemid', systemid) | 550 node.HandleAttribute('systemid', systemid) |
549 node.EndParsing() | 551 node.EndParsing() |
550 return node | 552 return node |
OLD | NEW |