BUGFIX
[wifihood] / wifiscanner / wifimap / replay.py
index 0130e60..3d3113d 100644 (file)
@@ -37,7 +37,7 @@ class ReplayScanner ( gobject.GObject ) :
         self.newaps = False
         self.aps = {}
 
-    def start ( self , timeout=5000 ) :
+    def start ( self , timeout=5000 , writelog=False ) :
         self.scan_timeout = timeout
         self.db.open()
         self._fd = open( self._file )
@@ -77,7 +77,7 @@ class ReplayScanner ( gobject.GObject ) :
             stored = self.db.db.execute( "SELECT rss, n, lat, lon FROM ap WHERE mac='%s'" % mac ).fetchone()
             if stored :
                 if not self.aps.has_key( mac ) :
-                    self.aps[ mac ] = stored[1:]
+                    self.aps[ mac ] = list(stored[1:])
                 if stored[0] > max_rss :
                     max_rss = stored[0]
                 self.db.update( mac , max_rss , self.tstamp , self.info[4:] )
@@ -86,9 +86,9 @@ class ReplayScanner ( gobject.GObject ) :
                 if not self.aps.has_key( mac ) :
                     self.aps[ mac ] = [ 0 , 0 , 0 ]
                 self.db.add( mac , max_rss , self.tstamp , self.info[4:] )
-            self.aps[0] += 1
-            self.aps[1] += self.info[4]
-            self.aps[2] += self.info[5]
+            self.aps[mac][0] += 1
+            self.aps[mac][1] += self.info[4]
+            self.aps[mac][2] += self.info[5]
         if newap :
             self.newap += newap
             self.newaps = True