Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def getIPInfo(addon):
# Generate request to find out where this IP is based
# Return ip info source, ip, location, isp
source = addon.getSetting("ip_info_source")
if (not source in getIPSources()):
addon.setSetting("ip_info_source", getIPSources()[0])
source = getIPSources()[0]
original_source = source
if isAutoSelect(source):
source = getAutoSource()
retry = 0
bad_response = False
services_used = 1
while retry < 6:
debugTrace("Getting IP info from " + source)
start_time = int(time.time())
ip, country, region, city, isp = getIPInfoFrom(source)
end_time = int(time.time())
response_time = end_time - start_time
def getIPInfo(addon):
# Generate request to find out where this IP is based
# Return ip info source, ip, location, isp
source = addon.getSetting("ip_info_source")
if (not source in getIPSources()):
addon.setSetting("ip_info_source", getIPSources()[0])
source = getIPSources()[0]
original_source = source
if isAutoSelect(source):
source = getAutoSource()
retry = 0
bad_response = False
services_used = 1
while retry < 6:
debugTrace("Getting IP info from " + source)
start_time = int(time.time())
ip, country, region, city, isp = getIPInfoFrom(source)
end_time = int(time.time())
response_time = end_time - start_time
debugTrace("Got response, IP is " + ip + ", response time in seconds is " + str(response_time))
def getIPInfo(addon):
# Generate request to find out where this IP is based
# Return ip info source, ip, location, isp
source = addon.getSetting("ip_info_source")
if (not source in getIPSources()):
addon.setSetting("ip_info_source", getIPSources()[0])
source = getIPSources()[0]
original_source = source
if isAutoSelect(source):
source = getAutoSource()
retry = 0
bad_response = False
services_used = 1
while retry < 6:
debugTrace("Getting IP info from " + source)
start_time = int(time.time())
ip, country, region, city, isp = getIPInfoFrom(source)
end_time = int(time.time())
response_time = end_time - start_time
debugTrace("Got response, IP is " + ip + ", response time in seconds is " + str(response_time))