--- /dev/null
+
+import gconf
+
+class Configuration :
+
+ def __init__ ( self ) :
+ self.homedir = None
+ self.dbname = None
+ self.read()
+
+ def read ( self ) :
+ client = gconf.client_get_default()
+ self.homedir = client.get_string( "/apps/wifihood/basedir" )
+ self.dbname = client.get_string( "/apps/wifihood/dbname" )
+
+ def save ( self ) :
+ client = gconf.client_get_default()
+ client.set_string( "/apps/wifihood/basedir" , self.homedir )
+ client.set_string( "/apps/wifihood/dbname" , self.dbname )
+
+
import time
-import gps , db
+import config , db , gps
import gobject
import os
-home_dir = "/home/user/MyDocs"
+
+conf = config.Configuration()
class Scanner ( gps.GPSObject ) :
self.nfp = 0
self.scanlist = None
self.aplist = {}
- self.db = db.database( os.path.join( home_dir , "wifiscanner.db" ) )
+ self.db = db.database( os.path.join( conf.homedir , conf.dbname ) )
def start ( self ) :
osso_rpc = osso.Rpc(self.osso_context)
osso.SystemNote(self.osso_context).system_note_infoprint("Found %d APs" % len(scan_out) )
# hildon.hildon_banner_show_information( self._parent , "icon_path" , "Found %d APs" % len(scan_out) )
else :
- fd = open( os.path.join( home_dir , "wiscan_gui.info" ) , 'a' )
+ fd = open( os.path.join( conf.homedir , "wiscan_gui.info" ) , 'a' )
fd.write( "%s %s%s\n" % ( timestamp , self.gps_info , out_str ) )
fd.close()
if self.satellites :
- loclist = open( os.path.join( home_dir , "location.info" ) , 'a' )
+ loclist = open( os.path.join( conf.homedir , "location.info" ) , 'a' )
loclist.write ( "%s\n" % ( self.satellites ,) )
loclist.close()
if self.cell_info :
- celllist = open( os.path.join( home_dir , "cell.info" ) , 'a' )
+ celllist = open( os.path.join( conf.homedir , "cell.info" ) , 'a' )
celllist.write ( "%s\n" % ( self.cell_info ,) )
celllist.close()