diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-08 01:16:38 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 11:03:34 +0200 |
commit | be1df32bd3faa571343913da7f88d6b40378b195 (patch) | |
tree | fb2d9ff8ce2eb57d0ed42657dcc8be53f972c03d /pyload/utils | |
parent | Restructure pyload file tree (1) (diff) | |
download | pyload-be1df32bd3faa571343913da7f88d6b40378b195.tar.xz |
New printer (windows compatible)
Diffstat (limited to 'pyload/utils')
-rw-r--r-- | pyload/utils/printer.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/pyload/utils/printer.py b/pyload/utils/printer.py new file mode 100644 index 000000000..488f42d4a --- /dev/null +++ b/pyload/utils/printer.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- + +import colorama + +colorama.init(autoreset=True) + +def color(color, text): + return colorama.Fore.(c.upper())(text) + +for c in colorama.Fore: + eval("%(color) = lambda msg: color(%(color), msg)" % {'color': c.lower()} + + +def overline(line, msg): + print "\033[%(line)s;0H\033[2K%(msg)s" % {'line': str(line), 'msg': msg} |