BUGFIX : report only those AP that are completelly new
authorjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 11:40:27 +0000 (11:40 +0000)
committerjaviplx <javiplx@gmail.com>
Sun, 10 Oct 2010 11:40:27 +0000 (11:40 +0000)
git-svn-id: file:///svnroot/wifihood/trunk/wifiscanner@39 c51dfc6a-5949-4919-9c8e-f207a149c383

wifimap/wifiscan.py

index 97a7754..d87f624 100644 (file)
@@ -25,7 +25,7 @@ class Scanner ( gps.GPSObject ) :
         self.nscan = 0
         self.nfp = 0
         self.scanlist = None
-        self.aplist = {}
+        self.newap = 0
         self.db = db.database( os.path.join( conf.homedir , conf.dbname ) )
 
     def start ( self ) :
@@ -64,8 +64,8 @@ class Scanner ( gps.GPSObject ) :
                     max_rss = stored[0]
                 self.db.update( items[0] , max_rss , timestamp )
             else :
+                self.newap += 1
                 self.db.add( items[0] , int(items[1]) , timestamp )
-            self.aplist[ items[0] ] = 1
         self.refresh_infowin()
         if self._debug :
             osso.SystemNote(self.osso_context).system_note_infoprint("Found %d APs" % len(scan_out) )
@@ -90,7 +90,7 @@ class Scanner ( gps.GPSObject ) :
 
     def refresh_infowin ( self ) :
         if self.status :
-            self.status.set_text( "%d gps\t%d scan\t%d fp\t%d ap\t%d total ap" % ( self.ngps , self.nscan , self.nfp , len(self.aplist.keys()) , self.db.nrows() ) )
+            self.status.set_text( "%d gps\t%d scan\t%d fp\t%d ap\t%d total ap" % ( self.ngps , self.nscan , self.nfp , self.newap , self.db.nrows() ) )
 
 
 gobject.type_register(Scanner)