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

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

Issue 227073006: Added a policy writer for iOS Plists. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: rebase Created 6 years, 8 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
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 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
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)
OLDNEW
« no previous file with comments | « grit/format/policy_templates/writers/json_writer_unittest.py ('k') | grit/format/policy_templates/writers/reg_writer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698