cleanup
This commit is contained in:
parent
aa03438280
commit
0d199267a8
@ -6,7 +6,7 @@ def readConf(fileLoc):
|
||||
try:
|
||||
jsonData = json.loads(f.openFile(os.path.expanduser(fileLoc)).read())
|
||||
except Exception as e:
|
||||
print e
|
||||
print("File not found, you will need to copy the config to your home directory")
|
||||
jasonData = ""
|
||||
return jsonData
|
||||
|
||||
|
||||
BIN
libs/config.pyc
BIN
libs/config.pyc
Binary file not shown.
6
main.py
6
main.py
@ -29,7 +29,6 @@ CSVFile = jsonData["country_codes"]
|
||||
if platform.system().lower() == "linux":
|
||||
import readline
|
||||
else:
|
||||
#do windows stuff here
|
||||
colour_attn = ""
|
||||
colour_good = ""
|
||||
colour_pretty = ""
|
||||
@ -39,7 +38,6 @@ running = 1
|
||||
prompt = ': '
|
||||
indent = '~ '
|
||||
whoisrecs = ["NotFound", "DomainName", "Registrar", "Status", "UpdatedDate", "CreationDate", "ExpirationDate", "RegistrantName", "RegistrantEmail", "EligibilityName", "EligibilityType", "EligibilityID", "RegistrantID", "NameServer"]
|
||||
#ipData = ["asn_country_code", "asn_description"]
|
||||
ipData = {"asn_country_code":"Country", "asn_description":"Owner"}
|
||||
|
||||
CountryDict = cc.parseCSV(cc.openCSV(CSVFile))
|
||||
@ -49,7 +47,6 @@ def domainWhois(inData):
|
||||
return whois.Parser(inData, whoisData[1]).parse()
|
||||
|
||||
def signal_handler(singal, frame):
|
||||
#print('\n')
|
||||
quit()
|
||||
|
||||
def printWhois(resultData):
|
||||
@ -77,7 +74,6 @@ def parseInput(inData):
|
||||
if tmpInData == "quit":
|
||||
quit()
|
||||
if checkIfIP(tmpInData):
|
||||
##IP lookup code
|
||||
lookupIP(tmpInData)
|
||||
else:
|
||||
lookupDomain(tmpInData)
|
||||
@ -132,8 +128,6 @@ def lookupIP(inData):
|
||||
ipnet = Net(inData)
|
||||
ipobj = IPASN(ipnet)
|
||||
results = ipobj.lookup()
|
||||
#for key,value in results.iteritems():
|
||||
# print('%s: %s' % (key, value))
|
||||
for types in ipData:
|
||||
if types == "asn_country_code":
|
||||
print(indent + "%s%s:%s\t%s%s" % (colour_pretty, ipData[types], colour_good, CountryDict[results[types]], colour_default))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user