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