From 7b634cc434bb3bb26df9ed78c7892d15a97519b7 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 7 Sep 2011 09:15:21 -0400 Subject: [PATCH] overviewer.py no longer loops forever if it can't find terrain.png There's also a more helpful error if any texture can't be found. Closes #475. --- overviewer.py | 10 ++++++++-- overviewer_core/textures.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/overviewer.py b/overviewer.py index 64a1a84..a7234a8 100755 --- a/overviewer.py +++ b/overviewer.py @@ -30,7 +30,7 @@ import multiprocessing import time import logging import platform -from overviewer_core import util +from overviewer_core import util, textures logging.basicConfig(level=logging.INFO,format="%(asctime)s [%(levelname)s] %(message)s") @@ -147,7 +147,6 @@ def main(): if options.check_terrain: import hashlib from overviewer_core.textures import _find_file - from overviewer_core import textures if options.textures_path: textures._find_file_local_path = options.textures_path @@ -276,6 +275,13 @@ dir but you forgot to put quotes around the directory, since it contains spaces. if not useBiomeData: logging.info("Notice: Not using biome data for tinting") + # make sure that the textures can be found + try: + textures.generate() + except IOError, e: + logging.error(str(e)) + sys.exit(1) + # First do world-level preprocessing w = world.World(worlddir, destdir, useBiomeData=useBiomeData, regionlist=regionlist, north_direction=north_direction) if north_direction == 'auto': diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 15bc30f..7b8bac6 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -97,7 +97,7 @@ def _find_file(filename, mode="rb", verbose=False): except (KeyError, IOError): pass - raise IOError("Could not find the file {0}. Is Minecraft installed? If so, I couldn't find the minecraft.jar file.".format(filename)) + raise IOError("Could not find the file `{0}'. You can either place it in the same place as overviewer.py, use --textures-path, or install the Minecraft client.".format(filename)) def _load_image(filename): """Returns an image object"""