diff --git a/kismetdb/scripts/log_to_kml.py b/kismetdb/scripts/log_to_kml.py index f5f6c9b..e6f54f3 100644 --- a/kismetdb/scripts/log_to_kml.py +++ b/kismetdb/scripts/log_to_kml.py @@ -16,7 +16,7 @@ def main(): parser.add_argument("--in", action="store", dest="infile", help="Input (.kismet) file") parser.add_argument("--out", action="store", dest="outfile", - help="Output filename (optional)") + default="out.kml", help="Output filename (optional)") parser.add_argument("--start-time", action="store", dest="starttime", help="Only list devices seen after given time") parser.add_argument("--min-signal", action="store", dest="minsignal", @@ -30,6 +30,8 @@ def main(): parser.add_argument("--ssid", action="store", dest="ssid", help=("Only plot networks which match the SSID " "(or SSID regex)")) + parser.add_argument("--debug", action="store_true", dest="debug", + help="Enable debug mode") results = parser.parse_args() @@ -97,14 +99,18 @@ def main(): title = mac kml.newpoint(name=title, - coords=[(loc["kismet.common.location.lon"], - loc["kismet.common.location.lat"], + coords=[(loc["kismet.common.location.geopoint"][0], + loc["kismet.common.location.geopoint"][1], loc["kismet.common.location.alt"])]) num_plotted = num_plotted + 1 - except TypeError: + except TypeError as err: + if results.debug: + print("Type error: {}".format(err)) continue - except KeyError: + except KeyError as err: + if results.debug: + print("Key error: {}".format(err)) continue kml.save(results.outfile) print("Exported {} devices to {}".format(num_plotted, results.outfile))