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 |
Joao da Silva
2014/10/13 10:30:58
This isn't used
cschuet (SLOW)
2014/10/14 18:55:20
Done.
|
class TemplateWriter(object): |
'''Abstract base class for writing policy templates in various formats. |
@@ -102,6 +103,16 @@ |
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 |
Joao da Silva
2014/10/13 10:30:58
Note that python functions return None by default,
cschuet (SLOW)
2014/10/14 18:55:20
This was the way I originally implemented this. Bu
|
+ been set.''' |
+ |
+ if 'version' in self.config: |
+ 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 +202,13 @@ |
''' |
raise NotImplementedError() |
+ def WriteComment(self, comment): |
+ '''Appends the comment to the internal buffer. |
Joao da Silva
2014/10/13 10:30:58
Remove trailing whitespaces from this line.
cschuet (SLOW)
2014/10/14 18:55:20
Done.
|
+ |
+ comment: The comment to be added. |
Joao da Silva
2014/10/13 10:30:58
From this one too
cschuet (SLOW)
2014/10/14 18:55:20
Done.
|
+ ''' |
+ raise NotImplementedError() |
+ |
def WriteRecommendedPolicy(self, policy): |
'''Appends the template text corresponding to a recommended policy into the |
internal buffer. |