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

Unified Diff: grit/format/policy_templates/writers/plist_writer.py

Issue 138343003: Output the subkey type for list policies on the plist generator. (Closed) Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master
Patch Set: fix upload Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/policy_templates/writers/plist_writer.py
diff --git a/grit/format/policy_templates/writers/plist_writer.py b/grit/format/policy_templates/writers/plist_writer.py
index 25a8c0bbdc7d905ffded00a3fde5aeeb71312c43..46b7adec8d19eb641c9bf5daba1402683e408044 100644
--- a/grit/format/policy_templates/writers/plist_writer.py
+++ b/grit/format/policy_templates/writers/plist_writer.py
@@ -9,6 +9,10 @@ from grit.format.policy_templates.writers import plist_helper
from grit.format.policy_templates.writers import xml_formatted_writer
+# This writer outputs a Preferences Manifest file as documented at
+# https://developer.apple.com/library/mac/documentation/MacOSXServer/Conceptual/Preference_Manifest_Files
+
+
def GetWriter(config):
'''Factory method for creating PListWriter objects.
See the constructor of TemplateWriter for description of
@@ -103,6 +107,11 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter):
else:
element_type = 'string'
self.AddElement(range_list, element_type, {}, str(item['value']))
+ elif policy_type == 'list':
+ subkeys = self._AddKeyValuePair(dict, 'pfm_subkeys', 'array')
+ subkeys_dict = self.AddElement(subkeys, 'dict')
+ subkeys_type = self._AddKeyValuePair(subkeys_dict, 'pfm_type', 'string')
+ self.AddText(subkeys_type, 'string')
def BeginTemplate(self):
self._plist.attributes['version'] = '1'
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698