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

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

Issue 91233003: Improve platform support indications for policy documentation. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 | « grit/format/policy_templates/writers/doc_writer_unittest.py ('k') | 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/template_writer.py
===================================================================
--- grit/format/policy_templates/writers/template_writer.py (revision 138)
+++ grit/format/policy_templates/writers/template_writer.py (working copy)
@@ -87,6 +87,17 @@
'''Checks if the given policy can be recommended.'''
return policy.get('features', {}).get('can_be_recommended', False)
+ def IsPolicySupportedOnPlatform(self, policy, platform):
+ '''Checks if |policy| is supported on |platform|.
+
+ Args:
+ policy: The dictionary of the policy.
+ platform: The platform to check; one of 'win', 'mac', 'linux' or
+ 'chrome_os'.
+ '''
+ is_supported = lambda x: platform in x['platforms']
+ return any(filter(is_supported, policy['supported_on']))
+
def _GetPoliciesForWriter(self, group):
'''Filters the list of policies in the passed group that are supported by
the writer.
« no previous file with comments | « grit/format/policy_templates/writers/doc_writer_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698