# HG changeset patch # User Beliar # Date 1330203939 -3600 # Node ID 0296f5f74a0f1a79cae656cc6d73d8ede92ec589 # Parent 5b880b8cff6d430b29136d20fb5f7a40445fc0bb Fixed saving and loading that broke with changing of the settings module. diff -r 5b880b8cff6d -r 0296f5f74a0f gamemodel.py --- a/gamemodel.py Sat Feb 25 00:21:28 2012 +0100 +++ b/gamemodel.py Sat Feb 25 22:05:39 2012 +0100 @@ -213,12 +213,12 @@ @type filename: string @param filename: the name of the file (including path) to load from @return: None""" - fname = '/'.join([path, filename]) + fname = os.path.join(path, filename) try: load_file = open(fname, 'r') except(IOError): - sys.stderr.write("Error: Can't find save game file\n") + sys.stderr.write("Error: Can't find save game file '" + fname + "'\n") return self.deleteMaps() self.clearAgents() diff -r 5b880b8cff6d -r 0296f5f74a0f gui/filebrowser.py --- a/gui/filebrowser.py Sat Feb 25 00:21:28 2012 +0100 +++ b/gui/filebrowser.py Sat Feb 25 22:05:39 2012 +0100 @@ -50,7 +50,9 @@ # FIXME M. George Hansen 2011-06-06: Not sure that user_path is set # correctly atm. Plus, I don't think that this should be # hard-coded. - self.path = os.path.join(self.settings.user_path, 'saves') + self.path = os.path.relpath(os.path.join(self.settings.get("parpg", "DataPath"), 'saves')) + if not os.path.exists(self.path): + os.makedirs(self.path) self.dir_list = [] self.file_list = [] @@ -115,7 +117,6 @@ listDirectories(self.path)) file_list = filter(lambda f: f.split('.')[-1] in self.extensions, \ self.engine.getVFS().listFiles(self.path)) - self.dir_list = decodeList(dir_list) self.file_list = decodeList(file_list) self._widget.distributeInitialData({