b.v.f.Template(object) : class documentation

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']
Method __init__ Undocumented
Method add Undocumented
Method process Undocumented
def __init__(self):
Undocumented
def add(self, name, value):
Undocumented
def process(self, tpl):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.