summaryrefslogtreecommitdiffstats
path: root/module/utils/printer.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/utils/printer.py')
-rw-r--r--module/utils/printer.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/module/utils/printer.py b/module/utils/printer.py
new file mode 100644
index 000000000..5d333e238
--- /dev/null
+++ b/module/utils/printer.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+# @author: vuolter
+
+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}