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

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

Issue 631223003: Include chromium version number in policy templates (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 2 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
Index: grit/format/policy_templates/writers/template_writer.py
===================================================================
--- grit/format/policy_templates/writers/template_writer.py (revision 177)
+++ grit/format/policy_templates/writers/template_writer.py (working copy)
@@ -3,6 +3,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
class TemplateWriter(object):
'''Abstract base class for writing policy templates in various formats.
@@ -102,6 +103,15 @@
is_supported = lambda x: platform in x['platforms']
return any(filter(is_supported, policy['supported_on']))
+ def _GetChromiumVersionString(self):
+ '''Returns the Chromium version string stored in the environment variable
+ version (if it is set).
+
+ Returns: The Chromium version string or an empty string if it has not been set.
pastarmovj 2014/10/07 14:54:36 too long.
cschuet1 2014/10/07 15:42:47 Done.
+ '''
+ if('version' in self.config):
pastarmovj 2014/10/07 14:54:36 space after if, no braces.
cschuet1 2014/10/07 15:42:47 Done.
+ return self.config['version']
+
def _GetPoliciesForWriter(self, group):
'''Filters the list of policies in the passed group that are supported by
the writer.
@@ -191,6 +201,13 @@
'''
raise NotImplementedError()
+ def WriteComment(self, comment):
+ '''Appends the comment to the internal buffer.
pastarmovj 2014/10/07 14:54:36 something is fishy with those lines - too many whi
cschuet1 2014/10/07 15:42:47 Done.
+ Args:
+ comment: The comment to be added.
+ '''
+ raise NotImplementedError()
+
def WriteRecommendedPolicy(self, policy):
'''Appends the template text corresponding to a recommended policy into the
internal buffer.

Powered by Google App Engine
This is Rietveld 408576698