demo/demo_ansicolor.py
author Radek Brich <brich.radek@ifortuna.cz>
Fri, 16 Aug 2013 13:23:49 +0200
changeset 7 776ba4914dfc
parent 5 055f7dfb3e4f
permissions -rwxr-xr-x
Update ConfigParser: rename 'type_' back to 'type'. Rename project in setup.py to make RPM package names more standard.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     1
#!/usr/bin/env python3
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
from pycolib.ansicolor import highlight, names
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     4
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     6
def print_colors():
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
    for c in range(0,8):
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
        print(
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     9
            highlight(1,c), names[c].ljust(20),
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
            highlight(1,8+c), names[c].ljust(20),
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
            highlight(0), sep='')
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    12
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
if __name__ == '__main__':
055f7dfb3e4f Refactor ansicolor, add demo.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
    print_colors()