From 1f97de27d384a2a9304c20283288fd46e7a0140a Mon Sep 17 00:00:00 2001 From: "Christos.K" Date: Sun, 10 Sep 2017 20:57:25 +0300 Subject: Text output py script --- scripts/pyfunctions/gseout.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scripts/pyfunctions/gseout.py diff --git a/scripts/pyfunctions/gseout.py b/scripts/pyfunctions/gseout.py new file mode 100644 index 0000000..88729dc --- /dev/null +++ b/scripts/pyfunctions/gseout.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3.6 + +from sys import exit + +# Output colors +class report_colors: + SRED = "\033[0;31m" + LRED = "\033[1;31m" + BLUE = "\033[0;34m" + YELLOW = "\033[0;33m" + CYAN = "\033[1;36m" + GREEN = "\033[0;32m" + PURPLE = "\033[2;35m" + RESET = "\033[0;0m" + +# Die function +def die(error): + print(report_colors.SRED + error + report_colors.RESET) + exit(1) + +# Yellow report function +def e_report(report): + print(report_colors.YELLOW + report + report_colors.RESET) + +# Blue report function +def b_report(report): + print(report_colors.BLUE + report + report_colors.RESET) + +# Green report function +def g_report(report): + print(report_colors.GREEN + report + report_colors.RESET) + +# Purpule report function +def p_report(report): + print(report_colors.PURPLE + report + report_colors.RESET) + -- cgit v1.2.3-65-gdbad