diff --git a/mceutils.py b/mceutils.py index bffcc06..b6f550c 100644 --- a/mceutils.py +++ b/mceutils.py @@ -49,7 +49,7 @@ def alertException(func): alert("Canceled.") except pymclevel.infiniteworld.SessionLockLost as e: alert(e.message + "\n\nYour changes cannot be saved.") - + except Exception, e: logging.exception("Exception:") if ask("Error during {0}: {1!r}".format(func, e)[:1000], ["Report Error", "Okay"], default=1, cancel=0) == "Report Error": @@ -308,7 +308,7 @@ def loadAlphaTerrainTexture(): except Exception, e: print repr(e), "while loading texture pack info." - texW, texH, terraindata = loadPNGFile("terrain.png") + texW, texH, terraindata = loadPNGFile(os.path.join(directories.dataDir, "terrain.png")) def slurpZipExt(zipextfile): # zipextfile.read() doesn't read all available data @@ -414,6 +414,7 @@ def loadTextureFunc(w, h, ndata): def loadPNGTexture(filename): + filename = os.path.join(directories.dataDir, filename) try: w, h, ndata = loadPNGFile(filename) diff --git a/release.py b/release.py index ac250f5..2dc1adf 100644 --- a/release.py +++ b/release.py @@ -12,7 +12,7 @@ def get_version(): except: return 'unknown' - fin = open('RELEASE-VERSION', 'rb') + fin = open(os.path.join(directories.dataDir, 'RELEASE-VERSION'), 'rb') v = fin.read().strip() fin.close() @@ -28,7 +28,7 @@ def get_commit(): except: return 'unknown' - fin = open('GIT-COMMIT', 'rb') + fin = open(os.path.join(directories.dataDir, 'GIT-COMMIT'), 'rb') v = fin.read().strip() fin.close()