MCPcopy Create free account
hub / github.com/EASY233/Finger / getAttributable

Method getAttributable

lib/ipAttributable.py:24–42  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 return ip_list
23
24 def getAttributable(self):
25 ips = self.ipCollection()
26 try:
27 for ip in ips:
28 addr = []
29 data = str(self.searcher.binarySearch(ip)["region"].decode('utf-8')).split("|")
30 isp = data[4].replace("0", "")
31 data.pop(4)
32 data.pop(1)
33 for ad in data:
34 if ad != "0" and ad not in addr and "" != ad:
35 addr.append(ad)
36 address = ','.join(addr)
37 for value in Webinfo.result:
38 if value['ip'] == ip:
39 Webinfo.result[Webinfo.result.index(value)]["address"] = address
40 Webinfo.result[Webinfo.result.index(value)]["isp"] = isp
41 except Exception as e:
42 pass
43

Callers 1

__init__Method · 0.95

Calls 2

ipCollectionMethod · 0.95
binarySearchMethod · 0.80

Tested by

no test coverage detected