Chromium Code Reviews| 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 | 6 |
| 7 import json | 7 import json |
| 8 from xml.dom import minidom | 8 from xml.dom import minidom |
| 9 from grit import lazy_re | 9 from grit import lazy_re |
| 10 from grit.format.policy_templates.writers import xml_formatted_writer | 10 from grit.format.policy_templates.writers import xml_formatted_writer |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 583 | 583 |
| 584 def BeginPolicyGroup(self, group): | 584 def BeginPolicyGroup(self, group): |
| 585 self.WritePolicy(group) | 585 self.WritePolicy(group) |
| 586 self._indent_level += 1 | 586 self._indent_level += 1 |
| 587 | 587 |
| 588 def EndPolicyGroup(self): | 588 def EndPolicyGroup(self): |
| 589 self._indent_level -= 1 | 589 self._indent_level -= 1 |
| 590 | 590 |
| 591 def BeginTemplate(self): | 591 def BeginTemplate(self): |
| 592 # Add a <div> for the summary section. | 592 # Add a <div> for the summary section. |
| 593 if self._GetChromiumVersionString() is not None: | |
| 594 self.AddComment(self._main_div, self.config['build'] + ''' version: ''' + self._GetChromiumVersionString()) | |
|
pastarmovj
2014/10/07 14:54:35
Line too long and no need for triple quotes.
cschuet1
2014/10/07 15:42:46
Done.
| |
| 595 | |
| 593 summary_div = self.AddElement(self._main_div, 'div') | 596 summary_div = self.AddElement(self._main_div, 'div') |
| 594 self.AddElement(summary_div, 'a', {'name': 'top'}) | 597 self.AddElement(summary_div, 'a', {'name': 'top'}) |
| 595 self.AddElement(summary_div, 'br') | 598 self.AddElement(summary_div, 'br') |
| 596 self._AddTextWithLinks( | 599 self._AddTextWithLinks( |
| 597 summary_div, | 600 summary_div, |
| 598 self._GetLocalizedMessage('intro')) | 601 self._GetLocalizedMessage('intro')) |
| 599 self.AddElement(summary_div, 'br') | 602 self.AddElement(summary_div, 'br') |
| 600 self.AddElement(summary_div, 'br') | 603 self.AddElement(summary_div, 'br') |
| 601 self.AddElement(summary_div, 'br') | 604 self.AddElement(summary_div, 'br') |
| 602 # Add the summary table of policies. | 605 # Add the summary table of policies. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 687 } | 690 } |
| 688 | 691 |
| 689 # A simple regexp to search for URLs. It is enough for now. | 692 # A simple regexp to search for URLs. It is enough for now. |
| 690 self._url_matcher = lazy_re.compile('(http://[^\\s]*[^\\s\\.])') | 693 self._url_matcher = lazy_re.compile('(http://[^\\s]*[^\\s\\.])') |
| 691 | 694 |
| 692 def GetTemplateText(self): | 695 def GetTemplateText(self): |
| 693 # Return the text representation of the main <div> tag. | 696 # Return the text representation of the main <div> tag. |
| 694 return self._main_div.toxml() | 697 return self._main_div.toxml() |
| 695 # To get a complete HTML file, use the following. | 698 # To get a complete HTML file, use the following. |
| 696 # return self._doc.toxml() | 699 # return self._doc.toxml() |
| OLD | NEW |