Modify log format to store raw output from dbus scan
authorjaviplx <javiplx@gmail.com>
Mon, 11 Oct 2010 19:34:19 +0000 (19:34 +0000)
committerjaviplx <javiplx@gmail.com>
Mon, 11 Oct 2010 19:34:19 +0000 (19:34 +0000)
git-svn-id: file:///svnroot/wifihood/trunk@53 c51dfc6a-5949-4919-9c8e-f207a149c383

wifiscanner/wifimap/wifiscan.py

index 4035467..ff2e9e9 100644 (file)
@@ -56,21 +56,19 @@ class Scanner ( gps.GPSObject ) :
         latlon = None
         if self.gps_state == "FIX" :
             latlon = ( self.device.fix[4] , self.device.fix[5] , self.device.fix[7] )
-        out_str = self.store_scan( scan_out , tstamp , scan_out , latlon )
+        self.store_scan( scan_out , tstamp , scan_out , latlon )
         self.refresh_infowin( tstamp )
         if self._debug :
             osso.SystemNote(self.osso_context).system_note_infoprint("Found %d APs" % len(scan_out) )
         else :
-            self.write_logs( out_str )
+            self.write_logs( scan_out )
 
         return True
 
     def store_scan ( self , timestamp , scan_out , gps_info ) :
-        out_str = ""
         for net in scan_out.split() :
             self.nfp += 1
             items = net.rsplit(":", 1)
-            out_str += " %s %s" % ( items[0] , items[1] )
             if self.scanlist :
                 self.scanlist.insert_at_cursor( "%s %5d\n" % ( items[0] , int(items[1]) ) )
             stored = self.db.get( items[0] )
@@ -82,9 +80,8 @@ class Scanner ( gps.GPSObject ) :
             else :
                 self.newap += 1
                 self.db.add( items[0] , int(items[1]) , timestamp , gps_info )
-        return out_str
 
-    def store_logscan ( self , timestamp , scan_out , gps_info ) :
+    def store_legacy ( self , timestamp , scan_out , gps_info ) :
         nets = scan_out.split()
         while nets :
             self.nfp += 1
@@ -103,7 +100,7 @@ class Scanner ( gps.GPSObject ) :
 
     def write_logs ( self , timestamp , out_str ) :
             fd = open( os.path.join( conf.homedir , "wiscan_gui.info" ) , 'a' )
-            fd.write( "%s %s%s\n" % ( timestamp , self.gps_info , out_str ) )
+            fd.write( "%s %s %s\n" % ( timestamp , self.gps_info , out_str ) )
             fd.close()
             if self.satellites :
                 loclist = open( os.path.join( conf.homedir , "location.info" ) , 'a' )