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

Unified Diff: grit/format/interface.py

Issue 9965022: Allow substitution of messages as variables in other messages. (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Fix unit tests for policy writers. Created 8 years, 9 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 | « grit/format/data_pack.py ('k') | grit/format/js_map_format.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/interface.py
diff --git a/grit/format/interface.py b/grit/format/interface.py
index c7a2c334159cbd80d5ea67ccbcb511757653d39e..a9f31d04658b06313ec151cdf48ee8a69f7d6a60 100644
--- a/grit/format/interface.py
+++ b/grit/format/interface.py
@@ -11,22 +11,37 @@ import re
class ItemFormatter(object):
- '''Base class for a formatter that knows how to format a single item.'''
+ """Base class for a formatter that knows how to format a single item."""
- def Format(self, item, lang='', begin_item=True, output_dir='.'):
- '''Returns a Unicode string representing 'item' in the format known by this
- item formatter, for the language 'lang'. May be called once at the
- start of the item (begin_item == True) and again at the end
- (begin_item == False), or only at the start of the item (begin_item == True)
+ def Format(self, item, lang='', output_dir='.'):
+ """Format the start of this item.
+
+ Returns a Unicode string representing 'item' in the format known by this
+ item formatter, for the language 'lang'.
Args:
- item: anything
+ item: anything.
lang: 'en'
- begin_item: True | False
output_dir: '.'
- Return:
- u'hello'
- '''
- raise NotImplementedError()
+ Returns:
+ A unicode string.
+ """
+ return ''
+
+ def FormatEnd(self, item, lang='', output_dir='.'):
+ """Format the end of this item.
+
+ Returns a Unicode string representing the closure of 'item' in the
+ format known by this item formatter, for the language 'lang'.
+ Called (optionally) after the children of item have been formatted.
+
+ Args:
+ item: anything
+ lang: 'en'
+ output_dir: '.'
+ Returns:
+ A unicode string.
+ """
+ return ''
« no previous file with comments | « grit/format/data_pack.py ('k') | grit/format/js_map_format.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698