0

working versions, data files, and package metadata

This commit is contained in:
Aaron Griffith
2011-05-13 22:24:49 -04:00
parent e84ef2c1d2
commit 4ec1b4c971
7 changed files with 45 additions and 32 deletions

View File

@@ -97,7 +97,7 @@ class MapGen(object):
blank.save(os.path.join(tileDir, "blank."+quadtree.imgformat))
# copy web assets into destdir:
mirror_dir(os.path.join(util.get_program_path(), "web_assets"), self.destdir)
mirror_dir(os.path.join(util.get_program_path(), "overviewer_core", "data", "web_assets"), self.destdir)
# do the same with the local copy, if we have it
if self.web_assets_path:
mirror_dir(self.web_assets_path, self.destdir)

View File

@@ -32,8 +32,8 @@ def _find_file(filename, mode="rb"):
This searches the following locations in this order:
* the textures_path given in the config file (if present)
* The program dir (same dir as this file)
* The program dir / textures
* The program dir (same dir as overviewer.py)
* The overviewer_core textures dir
* On Darwin, in /Applications/Minecraft
* Inside minecraft.jar, which is looked for at these locations
@@ -53,7 +53,7 @@ def _find_file(filename, mode="rb"):
if os.path.exists(path):
return open(path, mode)
path = os.path.join(programdir, "textures", filename)
path = os.path.join(programdir, "overviewer_core", "data", "textures", filename)
if os.path.exists(path):
return open(path, mode)

View File

@@ -27,9 +27,9 @@ def get_program_path():
return os.path.dirname(sys.executable)
else:
try:
# normally, we're in ./overviewer/util.py
# we want ./overviewer/data/
return os.path.join(os.path.dirname(__file__), 'data')
# normally, we're in ./overviewer_core/util.py
# we want ./
return os.path.dirname(os.path.dirname(__file__))
except NameError:
return os.path.dirname(sys.argv[0])