| 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.format.policy_templates.writers import plist_helper | 8 from grit.format.policy_templates.writers import plist_helper |
| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 app_name = plist_helper.GetPlistFriendlyName(self.config['app_name']) | 120 app_name = plist_helper.GetPlistFriendlyName(self.config['app_name']) |
| 121 self._AddStringKeyValuePair(dict, 'pfm_name', app_name) | 121 self._AddStringKeyValuePair(dict, 'pfm_name', app_name) |
| 122 self._AddStringKeyValuePair(dict, 'pfm_description', '') | 122 self._AddStringKeyValuePair(dict, 'pfm_description', '') |
| 123 self._AddStringKeyValuePair(dict, 'pfm_title', '') | 123 self._AddStringKeyValuePair(dict, 'pfm_title', '') |
| 124 self._AddStringKeyValuePair(dict, 'pfm_version', '1') | 124 self._AddStringKeyValuePair(dict, 'pfm_version', '1') |
| 125 self._AddStringKeyValuePair(dict, 'pfm_domain', | 125 self._AddStringKeyValuePair(dict, 'pfm_domain', |
| 126 self.config['mac_bundle_id']) | 126 self.config['mac_bundle_id']) |
| 127 | 127 |
| 128 self._array = self._AddKeyValuePair(dict, 'pfm_subkeys', 'array') | 128 self._array = self._AddKeyValuePair(dict, 'pfm_subkeys', 'array') |
| 129 | 129 |
| 130 def Init(self): | 130 def CreatePlistDocument(self): |
| 131 dom_impl = minidom.getDOMImplementation('') | 131 dom_impl = minidom.getDOMImplementation('') |
| 132 doctype = dom_impl.createDocumentType( | 132 doctype = dom_impl.createDocumentType( |
| 133 'plist', | 133 'plist', |
| 134 '-//Apple//DTD PLIST 1.0//EN', | 134 '-//Apple//DTD PLIST 1.0//EN', |
| 135 'http://www.apple.com/DTDs/PropertyList-1.0.dtd') | 135 'http://www.apple.com/DTDs/PropertyList-1.0.dtd') |
| 136 self._doc = dom_impl.createDocument(None, 'plist', doctype) | 136 return dom_impl.createDocument(None, 'plist', doctype) |
| 137 |
| 138 def Init(self): |
| 139 self._doc = self.CreatePlistDocument() |
| 137 self._plist = self._doc.documentElement | 140 self._plist = self._doc.documentElement |
| 138 | 141 |
| 139 def GetTemplateText(self): | 142 def GetTemplateText(self): |
| 140 return self.ToPrettyXml(self._doc) | 143 return self.ToPrettyXml(self._doc) |
| OLD | NEW |