-
Notifications
You must be signed in to change notification settings - Fork 2
/
nodeaddr.py
45 lines (27 loc) · 954 Bytes
/
nodeaddr.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright (C) 2010 Sara Dar
# Released under GNU LGPL 2.1
# See LICENSE.txt for more information
#!/usr/bin/python
# plot.py
import wx
import pygeoip
GEOIP_FILENAME = 'GeoIP/GeoIP.dat'
class Nodes(wx.Dialog):
def __init__(self, parent,title,nodesaddr,nodesdist,size):
wx.Dialog.__init__(self, parent, wx.ID_ANY, title, size)
self.gi = pygeoip.GeoIP(GEOIP_FILENAME)
self.addresses=[]
self.list=[]
self.distances =nodesdist
self.addresses=nodesaddr
for i in range(len(self.addresses)):
location=self.gi.country_name_by_addr(
self.addresses[i][0])
#isp = self.gio.org_by_addr(self.addresses[i][0])
self.list.append((self.addresses[i],location))
self.addrtxt = wx.TextCtrl(self, size=wx.Size(200, -1),
value=str(self.list),
style=wx.TE_MULTILINE)
#print self.addresses[0]
def OnQuit(self, event):
self.Destroy()