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 from xml.dom import minidom | 7 from xml.dom import minidom |
8 from grit import lazy_re | 8 from grit import lazy_re |
9 from grit.format.policy_templates.writers import xml_formatted_writer | 9 from grit.format.policy_templates.writers import xml_formatted_writer |
10 | 10 |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
637 'string': 'String', | 637 'string': 'String', |
638 'int': 'Integer', | 638 'int': 'Integer', |
639 'main': 'Boolean', | 639 'main': 'Boolean', |
640 'int-enum': 'Integer', | 640 'int-enum': 'Integer', |
641 'string-enum': 'String', | 641 'string-enum': 'String', |
642 'list': 'List of strings', | 642 'list': 'List of strings', |
643 'string-enum-list': 'List of strings', | 643 'string-enum-list': 'List of strings', |
644 'dict': 'Dictionary', | 644 'dict': 'Dictionary', |
645 'external': 'External data reference', | 645 'external': 'External data reference', |
646 } | 646 } |
647 reg_dict = 'REG_SZ; %s' % self._GetLocalizedMessage( | |
pastarmovj
2014/08/28 15:27:45
It used to be REG_SZ, now it is REG_SZ; is this in
| |
648 'complex_policies_on_windows') | |
647 self._REG_TYPE_MAP = { | 649 self._REG_TYPE_MAP = { |
648 'string': 'REG_SZ', | 650 'string': 'REG_SZ', |
649 'int': 'REG_DWORD', | 651 'int': 'REG_DWORD', |
650 'main': 'REG_DWORD', | 652 'main': 'REG_DWORD', |
651 'int-enum': 'REG_DWORD', | 653 'int-enum': 'REG_DWORD', |
652 'string-enum': 'REG_SZ', | 654 'string-enum': 'REG_SZ', |
653 'dict': 'REG_SZ, encoded as a JSON string', | 655 'dict': reg_dict, |
654 } | 656 } |
655 # The CSS style-sheet used for the document. It will be used in Google | 657 # The CSS style-sheet used for the document. It will be used in Google |
656 # Sites, which strips class attributes from HTML tags. To work around this, | 658 # Sites, which strips class attributes from HTML tags. To work around this, |
657 # the style-sheet is a dictionary and the style attributes will be added | 659 # the style-sheet is a dictionary and the style attributes will be added |
658 # "by hand" for each element. | 660 # "by hand" for each element. |
659 self._STYLE = { | 661 self._STYLE = { |
660 'table': 'border-style: none; border-collapse: collapse;', | 662 'table': 'border-style: none; border-collapse: collapse;', |
661 'tr': 'height: 0px;', | 663 'tr': 'height: 0px;', |
662 'td': 'border: 1px dotted rgb(170, 170, 170); padding: 7px; ' | 664 'td': 'border: 1px dotted rgb(170, 170, 170); padding: 7px; ' |
663 'vertical-align: top; width: 236px; height: 15px;', | 665 'vertical-align: top; width: 236px; height: 15px;', |
(...skipping 10 matching lines...) Expand all Loading... | |
674 } | 676 } |
675 | 677 |
676 # A simple regexp to search for URLs. It is enough for now. | 678 # A simple regexp to search for URLs. It is enough for now. |
677 self._url_matcher = lazy_re.compile('(http://[^\\s]*[^\\s\\.])') | 679 self._url_matcher = lazy_re.compile('(http://[^\\s]*[^\\s\\.])') |
678 | 680 |
679 def GetTemplateText(self): | 681 def GetTemplateText(self): |
680 # Return the text representation of the main <div> tag. | 682 # Return the text representation of the main <div> tag. |
681 return self._main_div.toxml() | 683 return self._main_div.toxml() |
682 # To get a complete HTML file, use the following. | 684 # To get a complete HTML file, use the following. |
683 # return self._doc.toxml() | 685 # return self._doc.toxml() |
OLD | NEW |