From edd930df8c238864716e480319929b95151e0976 Mon Sep 17 00:00:00 2001 From: javiplx Date: Fri, 8 Oct 2010 22:29:18 +0000 Subject: [PATCH] Introduce an easily configurable data directory git-svn-id: file:///svnroot/wifihood/trunk/wifiscanner@31 c51dfc6a-5949-4919-9c8e-f207a149c383 --- wifimap/wifiscan.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wifimap/wifiscan.py b/wifimap/wifiscan.py index 2c28969..e5295fc 100644 --- a/wifimap/wifiscan.py +++ b/wifimap/wifiscan.py @@ -7,6 +7,9 @@ import gps import gobject +import os +home_dir = "/home/user/MyDocs" + class Scanner ( gps.GPSObject ) : def __init__ ( self , widget=None , ifname="wlan0" ) : @@ -53,15 +56,15 @@ class Scanner ( gps.GPSObject ) : 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( "/home/user/MyDocs/wiscan_gui.info" , 'a' ) + fd = open( os.path.join( home_dir , "wiscan_gui.info" ) , 'a' ) fd.write( "%s %s%s\n" % ( time.time() , self.gps_info , out_str ) ) fd.close() if self.satellites : - loclist = open( "/home/user/MyDocs/location.info" , 'a' ) + loclist = open( os.path.join( home_dir , "location.info" ) , 'a' ) loclist.write ( "%s\n" % ( self.satellites ,) ) loclist.close() if self.cell_info : - celllist = open( "/home/user/MyDocs/cell.info" , 'a' ) + celllist = open( os.path.join( home_dir , "cell.info" ) , 'a' ) celllist.write ( "%s\n" % ( self.cell_info ,) ) celllist.close() -- 1.7.9.5