changeset 299:ff8bc835260c

Changed the location where rio_de_hola client puts the savefile.xml by using the getUserDataDirectory utility function to fix the permission denied error seen by LinuxDonald.
author vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 06 Jul 2009 01:35:34 +0000
parents 07709bffab8f
children 1465536aec94
files clients/rio_de_hola/run.py
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/clients/rio_de_hola/run.py	Sun Jul 05 19:11:53 2009 +0000
+++ b/clients/rio_de_hola/run.py	Mon Jul 06 01:35:34 2009 +0000
@@ -20,6 +20,7 @@
 import pychan
 import pychan.widgets as widgets
 from settings import Setting
+from fife_utils import getUserDataDirectory
 
 TDS = Setting()
 
@@ -158,7 +159,16 @@
 	def _pump(self):
 		if self.listener.quit:
 			self.breakRequested = True
-			self.world.save('maps/savefile.xml')
+			
+			# get the correct directory to save the map file to
+			mapSaveDir = getUserDataDirectory("fife", "rio_de_hola") + "/maps"
+			
+			# create the directory structure if it does not exist
+			if not os.path.isdir(mapSaveDir):
+				os.makedirs(mapSaveDir)
+			
+			# save map file to directory
+			self.world.save(mapSaveDir + "/savefile.xml")
 		else:
 			self.world.pump()