summaryrefslogtreecommitdiffstats
path: root/pyload/utils
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-08 01:16:38 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 11:03:34 +0200
commitbe1df32bd3faa571343913da7f88d6b40378b195 (patch)
treefb2d9ff8ce2eb57d0ed42657dcc8be53f972c03d /pyload/utils
parentRestructure pyload file tree (1) (diff)
downloadpyload-be1df32bd3faa571343913da7f88d6b40378b195.tar.xz
New printer (windows compatible)
Diffstat (limited to 'pyload/utils')
-rw-r--r--pyload/utils/printer.py15
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}