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

Method setIpRange

test/testIPAddress.py:79–87  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

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

Callers 1

getIpAddrMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected