Message140010
>>> import string
>>> class MyTemplate(string.Template):
... delimiter = '.'
...
>>> MyTemplate.delimiter = 'x'
>>> mt = MyTemplate('.field xfield')
>>> mt.substitute(field=None)
'None xfield'
>>> mt.delimiter
'x'
>>>
If I want to change the pattern string by any delimiter, I should create a new class for every delimiter
I would change the delimiter either in the object or in the class at any time |
|
Date |
User |
Action |
Args |
2011-07-08 00:36:49 | py.user | set | recipients:
+ py.user |
2011-07-08 00:36:49 | py.user | set | messageid: <1310085409.68.0.478281072881.issue12518@psf.upfronthosting.co.za> |
2011-07-08 00:36:49 | py.user | link | issue12518 messages |
2011-07-08 00:36:48 | py.user | create | |
|