Changed colour system

This commit is contained in:
Benjamyn Love 2017-07-28 00:20:40 +10:00
parent 2862568505
commit ab241611e4

View File

@ -5,14 +5,13 @@ import readline
#Define Colours
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
RED = "\033[1;31m"
BLUE = "\033[1;34m"
CYAN = "\033[1;36m"
GREEN = "\033[0;32m"
RESET = "\033[0;0m"
BOLD = "\033[;1m"
REVERSE = "\033[;7m"
#FIXME: Have any CNAMES returned do a lookup and print it after the record.
@ -24,12 +23,12 @@ whoOn = "W"
phrases = ["ping", "whois", "quit", "clear", "help", "nameserver"]
def printHelp():
print bcolors.HEADER + "========================================================"
print bcolors.BLUE + "========================================================"
print "= help - This screen ="
print "= clear - Clears the screen ="
print "= ping - Enables/Disables pinging the IP Address ="
print "========================================================"
print "========================================================" + bcolors.ENDC
print "========================================================" + bcolors.RESET
def compareSOA(inNameservers, inDomain, origSOA):
dnsServer = '8.8.8.8'
@ -100,7 +99,7 @@ def options(inputs):
def iterate(inArray, pre):
count = 0
while count != len(inArray) - 1:
print bcolors.WARNING + pre, bcolors.OKGREEN + inArray[count] + bcolors.ENDC
print bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET
count = count + 1
def parseWhois(whioisInfo):
NS = re.compile("^[Nn]")
@ -109,7 +108,14 @@ def parseWhois(whioisInfo):
U = re.compile("^[Uu]")
for str in whioisInfo:
str.strip()
if NS.match(str) or D.match(str) or R.match(str) or U.match(str):
if "domain" in str:
if "ok" in str:
print bcolors.GREEN + str + bcolors.RESET
else:
print bcolors.RED + str + bcolors.RESET
else:
print str
def whois(inDomain):