Esempio n. 1
0
def print_callback(ttl, payload):
    if payload:
        curr_host = "%(hostname)s (%(ip)s)" % payload
        print "%d\t%s" % (ttl, curr_host)
        print "\t",
        print georesolve.lookup(**payload)
    else:
        print "%d\t*" % ttl
Esempio n. 2
0
def print_callback(ttl, payload):
	if payload:
		curr_host = "%(hostname)s (%(ip)s)" % payload
		print "%d\t%s" % (ttl, curr_host)
		print "\t",
		print georesolve.lookup(**payload)
	else:
		print "%d\t*" % ttl
Esempio n. 3
0
	def trace_callback(self, ttl, payload):
		payload_p = "%(hostname)s (%(ip)s)" % payload if payload else '*'
		print "%s\t%s" % (ttl, payload_p)
		self.tb.insert_at_cursor("%s\t%s\n" % (ttl, payload_p))
		if payload:
			res = georesolve.lookup(**payload)
			if georesolve.ACCURACY[res['accuracy']] > georesolve.ACCURACY['none']:
				print "\t",
				print res
				lat = res['lat']
				lng = res['lng']
				self.osm.gps_add(lat, lng, heading=osmgpsmap.INVALID);
Esempio n. 4
0
 def trace_callback(self, ttl, payload):
     payload_p = "%(hostname)s (%(ip)s)" % payload if payload else '*'
     print "%s\t%s" % (ttl, payload_p)
     self.tb.insert_at_cursor("%s\t%s\n" % (ttl, payload_p))
     if payload:
         res = georesolve.lookup(**payload)
         if georesolve.ACCURACY[
                 res['accuracy']] > georesolve.ACCURACY['none']:
             print "\t",
             print res
             lat = res['lat']
             lng = res['lng']
             self.osm.gps_add(lat, lng, heading=osmgpsmap.INVALID)