Zack Williams | 3dfe6af | 2016-04-30 11:37:09 -0700 | [diff] [blame] | 1 | from jinja2.utils import soft_unicode |
2 | |||||
3 | def format_string(string, pattern): | ||||
4 | """ | ||||
5 | formats the string with the value passed to it | ||||
6 | basicaly the reverse order of standard "format()" | ||||
7 | """ | ||||
8 | return soft_unicode(pattern) % (string) | ||||
9 | |||||
10 | class FilterModule(object): | ||||
11 | |||||
12 | def filters(self): | ||||
13 | return { | ||||
14 | 'format_string': format_string, | ||||
15 | } | ||||
16 |