/usr/lib/python3/dist-packages/curtsies/fmtfuncs.py is in python3-curtsies 0.2.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | from functools import partial as _partial
from itertools import chain as _chain
from .termformatconstants import FG_COLORS, BG_COLORS, STYLES
from .formatstring import fmtstr
for att in _chain(FG_COLORS, ('on_'+x for x in BG_COLORS), STYLES):
locals()[att] = _partial(fmtstr, style=att)
plain = _partial(fmtstr)
if __name__ == '__main__':
import doctest
doctest.testmod()
print((blue('adf')))
print((blue(on_red('ad'))))
print((blue('asdf') + on_red('adsf')))
print(((blue('asdf') + on_red('adsf'))[3:7]))
f = blue('hey there') + on_red(' Tom!')
print(f)
f[1:3] = 'ot'
print((repr(f)))
print(f)
f = on_blue(red('stuff'))
print((repr(f)))
print((repr(str(f))))
print(f)
print(((f + '!')[0:6] + '?'))
|