working versions, data files, and package metadata
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user