MCPcopy Create free account
hub / github.com/qiyeboy/IPProxyPool / setIpRange

Method setIpRange

util/IPAddress.py:80–88  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

78 logger.info("%d %s %s" % (index, self.ip2str(ip), address))
79
80 def setIpRange(self, index):
81 offset = self.firstIndex + index * 7
82 self.ipdb.seek(offset)
83 buf = self.ipdb.read(7)
84 (self.curStartIp, of1, of2) = struct.unpack("IHB", buf)
85 self.curEndIpOffset = of1 + (of2 << 16)
86 self.ipdb.seek(self.curEndIpOffset)
87 buf = self.ipdb.read(4)
88 (self.curEndIp,) = struct.unpack("I", buf)
89
90 def getIpAddr(self, ip):
91 L = 0

Callers 1

getIpAddrMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected