Changed colour system
This commit is contained in:
parent
2862568505
commit
ab241611e4
28
HTTPy.py
28
HTTPy.py
@ -5,14 +5,13 @@ import readline
|
|||||||
|
|
||||||
#Define Colours
|
#Define Colours
|
||||||
class bcolors:
|
class bcolors:
|
||||||
HEADER = '\033[95m'
|
RED = "\033[1;31m"
|
||||||
OKBLUE = '\033[94m'
|
BLUE = "\033[1;34m"
|
||||||
OKGREEN = '\033[92m'
|
CYAN = "\033[1;36m"
|
||||||
WARNING = '\033[93m'
|
GREEN = "\033[0;32m"
|
||||||
FAIL = '\033[91m'
|
RESET = "\033[0;0m"
|
||||||
ENDC = '\033[0m'
|
BOLD = "\033[;1m"
|
||||||
BOLD = '\033[1m'
|
REVERSE = "\033[;7m"
|
||||||
UNDERLINE = '\033[4m'
|
|
||||||
|
|
||||||
#FIXME: Have any CNAMES returned do a lookup and print it after the record.
|
#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"]
|
phrases = ["ping", "whois", "quit", "clear", "help", "nameserver"]
|
||||||
|
|
||||||
def printHelp():
|
def printHelp():
|
||||||
print bcolors.HEADER + "========================================================"
|
print bcolors.BLUE + "========================================================"
|
||||||
print "= help - This screen ="
|
print "= help - This screen ="
|
||||||
print "= clear - Clears the screen ="
|
print "= clear - Clears the screen ="
|
||||||
print "= ping - Enables/Disables pinging the IP Address ="
|
print "= ping - Enables/Disables pinging the IP Address ="
|
||||||
print "========================================================"
|
print "========================================================"
|
||||||
print "========================================================" + bcolors.ENDC
|
print "========================================================" + bcolors.RESET
|
||||||
|
|
||||||
def compareSOA(inNameservers, inDomain, origSOA):
|
def compareSOA(inNameservers, inDomain, origSOA):
|
||||||
dnsServer = '8.8.8.8'
|
dnsServer = '8.8.8.8'
|
||||||
@ -100,7 +99,7 @@ def options(inputs):
|
|||||||
def iterate(inArray, pre):
|
def iterate(inArray, pre):
|
||||||
count = 0
|
count = 0
|
||||||
while count != len(inArray) - 1:
|
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
|
count = count + 1
|
||||||
def parseWhois(whioisInfo):
|
def parseWhois(whioisInfo):
|
||||||
NS = re.compile("^[Nn]")
|
NS = re.compile("^[Nn]")
|
||||||
@ -109,7 +108,14 @@ def parseWhois(whioisInfo):
|
|||||||
U = re.compile("^[Uu]")
|
U = re.compile("^[Uu]")
|
||||||
|
|
||||||
for str in whioisInfo:
|
for str in whioisInfo:
|
||||||
|
str.strip()
|
||||||
if NS.match(str) or D.match(str) or R.match(str) or U.match(str):
|
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
|
print str
|
||||||
|
|
||||||
def whois(inDomain):
|
def whois(inDomain):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user