-import config
import db
import gobject
class ReplayScanner ( gobject.GObject ) :
- def __init__ ( self , ifname="wlan0" ) :
+ def __init__ ( self , conf , ifname="wlan0" ) :
gobject.GObject.__init__( self )
self.scan_timeout = 0
- conf = config.Configuration( 'scanner' )
self.db = db.database( os.path.join( conf.homedir , "wifireplay.db" ) )
# Values specific to replaying
import time
-import config , db
+import db
import gps , wifiscan
import gobject
class Scanner ( gps.GPSObject , wifiscan.WifiScanner ) :
- def __init__ ( self , ifname="wlan0" ) :
+ def __init__ ( self , conf , ifname="wlan0" ) :
gps.GPSObject.__init__( self )
wifiscan.WifiScanner.__init__( self , ifname )
- conf = config.Configuration( 'scanner' )
+ self.db = db.database( os.path.join( conf.homedir , conf.dbname ) )
self.homedir = conf.homedir
- self.db = db.database( os.path.join( self.homedir , conf.dbname ) )
self.write = False
def __init__ ( self ) :
- _scanner = scanner( "wlan0" )
+ config = wifimap.config.Configuration( 'scanner' )
+ _scanner = scanner( config , "wlan0" )
self.connect("delete_event", gtk.main_quit, None)
scrollview = gtk.ScrolledWindow()
notebook.append_page( scrollview , gtk.Label("Scanning") )
- self.map = MapWindow()
+ self.map = MapWindow( config )
notebook.append_page( self.map , gtk.Label("Map") )
buttons = gtk.VBox(homogeneous=False, spacing=0)
# Buttons creation
button = self.Button( "Switch GPS On")
- button._id = button.connect("clicked", global_start, _scanner, self.map.config)
+ button._id = button.connect("clicked", global_start, _scanner, config)
buttons.pack_start(button, expand=False)
button_scan = self.Button( "Start scanning")
class MapWindow ( gtk.Frame ) :
def __init__(self):
- gtk.Frame.__init__( self )
+ gtk.Frame.__init__( self , config )
- self.config = wifimap.config.Configuration( 'scanner' )
+ self.config = config
self.add( wifimap.simpleMapWidget( self.config ) )
class Wifiscanner ( AbstractWifiscanner , hildon.StackableWindow ) :
class MapWindow ( gtk.Frame ) :
def __init__(self):
- gtk.Frame.__init__( self )
+ gtk.Frame.__init__( self , config )
- self.config = wifimap.config.Configuration( 'scanner' )
+ self.config = config
self.add( wifimap.simpleMapWidget( self.config , (640,400) ) )
class Wifiscanner ( AbstractWifiscanner , gtk.Window ) :