Index: src/django_gheat/gheat/management/commands/import_kismet.py
===================================================================
--- src/django_gheat/gheat/management/commands/import_kismet.py	(revision 9166)
+++ src/django_gheat/gheat/management/commands/import_kismet.py	(revision 9168)
@@ -51,27 +51,39 @@
   print "#INFO: Going to import %s points" % len(points)
   for point in points:
+    #XXX: This needs to be either the 'bssid' or the 'source', accesspoint from or too data.
+    bssid = point.attrib['bssid']
     # XXX: Filter this in the beginning with XPath, but etree does not support that (yet).
-    if point.attrib['bssid'] in ['GP:SD:TR:AC:KL:OG','00:00:00:00:00:00']:
+    if bssid in ['GP:SD:TR:AC:KL:OG','00:00:00:00:00:00']:
       continue
-    if point.attrib['bssid'] in ap_ignore:
+    elif bssid in ap_ignore:
       continue
-    ap = ap_cache[point.attrib['bssid']]
+    elif not ap_cache.has_key(bssid):
+      try:
+        ap = Accespoint.objects.get(mac=bssid)
+        ap_cache[bssid] = ap
+      except Accespoint.DoesNotExist:
+        print "#ERROR: Cannot found SSID for BSSID '%s'" % bssid
+        continue
 
     # XXX: Signal need properly be a relation of signal_dbm and noice_dbm
     signaal = 100 + int(point.attrib['signal_dbm'])
 
-    meting,created = Meting.objects.get_or_create(meetrondje=mr, accespoint=ap,
+    meting= Meting.objects.create(meetrondje=mr, accespoint=ap_cache[bssid],
       latitude=point.attrib['lat'], longitude=point.attrib['lon'],
       signaal=signaal)
     # Give some feedback to the user
-    if created:
-      count += 1
-      if (count % 1000) == 0:
-        print count,
-      elif (count % 100) == 0:
-        print ".",
+    count += 1
+    if (count % 1000) == 0:
+      sys.stdout.write(str(count))
+    elif (count % 100) == 0:
+      sys.stdout.write(".")
+    sys.stdout.flush()
+
+  sys.stdout.write("%s\n" % count)
+  print "#INFO: All done, goodbye"
+
 
 class Command(BaseCommand):
-  args = '<gpsxml> <netxml>'
+  args = '<gpsxml> [<netxml>]'
   option_list = BaseCommand.option_list + (
     make_option('-m', '--meetrondje', dest='meetrondje', default='rondje',help='Naam van het meetrondje'),
@@ -80,8 +92,13 @@
     )
 
-  # TODO: Condider netxml file to be the gpsxml file with diffent suffix.
   def handle(self, *args, **options):
     try:
-      (gpsxml_file, netxml_file) = args
+      if len(args) == 2:
+        (gpsxml_file, netxml_file) = args
+      elif len(args) == 1:
+        (gpsxml_file,) = args
+        netxml_file = gpsxml_file[:-6] + 'netxml'
+      else:
+        raise ValueError
     except ValueError:
       self.print_help(sys.argv[0],sys.argv[1])
