self.newaps = False
self.aps = {}
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 )
self.scan_timeout = timeout
self.db.open()
self._fd = open( self._file )
self.homedir = conf.homedir
self.db = db.database( os.path.join( self.homedir , conf.dbname ) )
self.homedir = conf.homedir
self.db = db.database( os.path.join( self.homedir , conf.dbname ) )
# Values to be set by wireless scans
self.newap = 0
self.newaps = False
self.aps = []
# Values to be set by wireless scans
self.newap = 0
self.newaps = False
self.aps = []
- def start ( self , timeout=5000 ) :
+ def start ( self , timeout=5000 , writelog=False ) :
gps.GPSObject.start( self )
wifiscan.WifiScanner.start( self , timeout )
self.db.open()
gps.GPSObject.start( self )
wifiscan.WifiScanner.start( self , timeout )
self.db.open()
def stop ( self ) :
gps.GPSObject.stop( self )
wifiscan.WifiScanner.stop( self )
self.db.close()
def stop ( self ) :
gps.GPSObject.stop( self )
wifiscan.WifiScanner.stop( self )
self.db.close()
def scan ( self ) :
wifiscan.WifiScanner.scan( self )
def scan ( self ) :
wifiscan.WifiScanner.scan( self )
if newap :
self.newap += newap
self.newaps = True
if newap :
self.newap += newap
self.newaps = True
+ if self.write :
+ self.write_logs()
def write_logs ( self ) :
fd = open( os.path.join( self.homedir , "wiscan_gui.info" ) , 'a' )
def write_logs ( self ) :
fd = open( os.path.join( self.homedir , "wiscan_gui.info" ) , 'a' )
hildon = False
def global_start(button, scanner, config):
hildon = False
def global_start(button, scanner, config):
- scanner.start( config.scan_period )
+ scanner.start( config.scan_period , config.store_log )
if button._id :
button.disconnect( button._id )
button._id = button.connect("clicked", global_stop, scanner, config)
if button._id :
button.disconnect( button._id )
button._id = button.connect("clicked", global_stop, scanner, config)