Refactoring to allow for multithreading later
This commit is contained in:
parent
266ba314b3
commit
927cdeb86d
BIN
.HTTPy.py.swp
Normal file
BIN
.HTTPy.py.swp
Normal file
Binary file not shown.
18
HTTPy.py
18
HTTPy.py
@ -3,8 +3,11 @@ import subprocess
|
||||
import re # YAY REVERSE ENGINEER... wait its just regex
|
||||
import readline
|
||||
import os
|
||||
from pprint import pprint
|
||||
#Made this work with linux magic, test
|
||||
|
||||
recordDict = {}
|
||||
|
||||
#Define Colours
|
||||
class bcolors:
|
||||
RED = "\033[1;31m"
|
||||
@ -23,7 +26,7 @@ running = 1
|
||||
pingOn = "p"
|
||||
whoOn = "W"
|
||||
phrases = ["ping", "whois", "quit", "clear", "help", "nameserver"]
|
||||
indent = '> '
|
||||
indent = '~ '
|
||||
|
||||
def openFile(filename):
|
||||
try:
|
||||
@ -140,10 +143,14 @@ def iterate(inArray, pre):
|
||||
else:
|
||||
if checkIfIP(inArray[count].split('.')) == 0:
|
||||
tmpVal = isCNAME(inArray[count])
|
||||
|
||||
print indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET + " -> " + bcolors.GREEN + tmpVal[0] + bcolors.RESET
|
||||
recordDict[pre] = inArray[count], tmpVal[0]
|
||||
#recordDict[pre] = indent + 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
|
||||
else:
|
||||
print indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET
|
||||
recordDict[pre] = inArray[count]
|
||||
#recordDict[pre] = indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET
|
||||
#print indent + bcolors.CYAN + pre, bcolors.GREEN + inArray[count] + bcolors.RESET
|
||||
count = count + 1
|
||||
|
||||
|
||||
@ -288,4 +295,7 @@ while running == 1:
|
||||
else:
|
||||
dnsRec, dnsType, blank = newdig(inInput, rec)
|
||||
iterate(dnsRec, dnsType)
|
||||
#pprint(recordDict)
|
||||
for data in recordDict:
|
||||
print recordDict[data]
|
||||
print '\n'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user