Made pretty

This commit is contained in:
Benjamyn Love 2017-09-25 09:21:24 +10:00
parent 2a66a25100
commit 9ae8cabfaa

View File

@ -22,7 +22,7 @@ running = 1
pingOn = "p"
whoOn = "W"
phrases = ["ping", "whois", "quit", "clear", "help", "nameserver"]
indent = '\t'
indent = '> '
def openFile(filename):
try:
@ -142,7 +142,7 @@ def iterate(inArray, pre):
print indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET + " -> " + bcolors.GREEN + tmpVal[0] + bcolors.RESET
else:
print bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET
print indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET
count = count + 1
@ -151,7 +151,7 @@ def iterateMX(inArray, pre):
while count != len(inArray) - 1:
tmp = inArray[count].split(' ')
tmpVal = isCNAME(tmp[1])
print bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET + " -> " + bcolors.GREEN + tmpVal[0] + bcolors.RESET
print indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET + " -> " + bcolors.GREEN + tmpVal[0] + bcolors.RESET
count = count + 1
def parseWhois(whioisInfo):
@ -169,14 +169,14 @@ def parseWhois(whioisInfo):
if "domain" in str or "Domain" in str and "Name" not in str or "Status" in str:
if "name" not in str and "ID" not in str:
if "ok" in str or "OK" in str:
print bcolors.GREEN + str + bcolors.RESET
print indent + bcolors.GREEN + str + bcolors.RESET
else:
print bcolors.RED + str + bcolors.RESET
print indent + bcolors.RED + str + bcolors.RESET
else:
if "Expired" in str or "expired" in str:
print bcolors.RED + str + bcolors.RESET
print indent + bcolors.RED + str + bcolors.RESET
else:
print str
print indent + str
def whois(inDomain):
lookup = subprocess.check_output(["whois", inDomain])