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

Side by Side Diff: grit/format/policy_templates/writers/doc_writer.py

Issue 631223003: Include chromium version number in policy templates (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
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 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
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'] + \
595 ' version: ' + self._GetChromiumVersionString())
596
593 summary_div = self.AddElement(self._main_div, 'div') 597 summary_div = self.AddElement(self._main_div, 'div')
594 self.AddElement(summary_div, 'a', {'name': 'top'}) 598 self.AddElement(summary_div, 'a', {'name': 'top'})
595 self.AddElement(summary_div, 'br') 599 self.AddElement(summary_div, 'br')
596 self._AddTextWithLinks( 600 self._AddTextWithLinks(
597 summary_div, 601 summary_div,
598 self._GetLocalizedMessage('intro')) 602 self._GetLocalizedMessage('intro'))
599 self.AddElement(summary_div, 'br') 603 self.AddElement(summary_div, 'br')
600 self.AddElement(summary_div, 'br') 604 self.AddElement(summary_div, 'br')
601 self.AddElement(summary_div, 'br') 605 self.AddElement(summary_div, 'br')
602 # Add the summary table of policies. 606 # Add the summary table of policies.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 } 691 }
688 692
689 # A simple regexp to search for URLs. It is enough for now. 693 # A simple regexp to search for URLs. It is enough for now.
690 self._url_matcher = lazy_re.compile('(http://[^\\s]*[^\\s\\.])') 694 self._url_matcher = lazy_re.compile('(http://[^\\s]*[^\\s\\.])')
691 695
692 def GetTemplateText(self): 696 def GetTemplateText(self):
693 # Return the text representation of the main <div> tag. 697 # Return the text representation of the main <div> tag.
694 return self._main_div.toxml() 698 return self._main_div.toxml()
695 # To get a complete HTML file, use the following. 699 # To get a complete HTML file, use the following.
696 # return self._doc.toxml() 700 # return self._doc.toxml()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698