-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeoroute.py
executable file
·43 lines (32 loc) · 946 Bytes
/
georoute.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
#!/usr/bin/env python3
# Trace Geological Route
from socket import gethostbyname
from traceroute import Traceroute
from geomap import Map
class GeoRoute:
def __init__(self, hostname):
self.engine = Map()
self.destination = gethostbyname(hostname)
self.tracer = Traceroute(self.destination, self.engine)
self.engine.markers.FILL = 'OrangeRed3'
self.engine.markers.LFILL = 'OrangeRed4'
self.tracer.CALLBACK = self.engine.clean
self.tracer.SEPERATOR = ''
def trace(self):
self.tracer.trace()
return self
if __name__ == '__main__':
from os import getuid
from sys import argv
# ensure root access for
# raw socket transmission
if getuid() != 0:
print('Missing Administrative Access!')
exit(2)
# TODO
# standardize cli arguments
if len(argv) == 2:
geotracer = GeoRoute(argv[1])
else:
geotracer = GeoRoute('www.ashenm.ml')
geotracer.trace().engine.window.mainloop()