Part of bzrlib.version_info_formats.format_custom View In Hierarchy
A simple template engine.
>>> t = Template() >>> t.add('test', 'xxx') >>> print list(t.process('{test}')) ['xxx'] >>> print list(t.process('{test} test')) ['xxx', ' test'] >>> print list(t.process('test {test}')) ['test ', 'xxx'] >>> print list(t.process('test {test} test')) ['test ', 'xxx', ' test'] >>> print list(t.process('{test}\\n')) ['xxx', '\n'] >>> print list(t.process('{test}\n')) ['xxx', '\n']