i3pyblocks.formatter
Module Contents
Classes
Extended formatter used by block classes. |
- class i3pyblocks.formatter.ExtendedFormatter
Bases:
string.FormatterExtended formatter used by block classes.
Includes supports for some extended conversion symbols, for example:
ex_format = ExtendedFormatter() s = "HellO WorlD!" print(ex_format("{!u}", s)) # "HELLO WORLD!" print(ex_format("{!l}", s)) # "hello world!" print(ex_format("{!c}", s)) # "Hello world!" print(ex_format("{!t}", s)) # "Hello World!"
- convert_field(self, value, conversion)
Extended conversion symbols.
The following additional symbols have been added:
l: convert to string and lower caseu: convert to string and UPPER CASEc: convert to string and Capitalizet: convert to string and Title-Ize
Defaults are:
s: convert with str()r: convert with repr()a: convert with ascii()