/usr/share/pyshared/fabulous/debug.py is in python-fabulous 0.1.5+dfsg1-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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | """
fabulous.debug
~~~~~~~~~~~~~~
"""
import sys
import itertools
from fabulous import image
class DebugImage(image.Image):
"""Visualize optimization techniques used by :class:`Image`
"""
def reduce(self, colors):
need_reset = False
line = ''
for color, items in itertools.groupby(colors):
if color is None:
if need_reset:
line = line[:-1] + ">"
need_reset = False
line += 'T' + (self.pad * len(list(items)))[1:]
elif color == "EOL":
if need_reset:
line = line[:-1] + ">"
need_reset = False
yield line.rstrip(' T')
else:
yield line.rstrip(' T')
line = ''
else:
need_reset = True
line += '<' + (self.pad * len(list(items)))[1:]
def main(args):
"""I provide a command-line interface for this module
"""
for imgpath in sys.argv[1:]:
for line in DebugImage(imgpath):
print line
if __name__ == '__main__':
main(sys.argv)
|