From 14b639d5dcd1480fc896cad1fbb882838e91008e Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Mon, 19 Sep 2011 20:33:59 -0400 Subject: [PATCH] fixed running overviewer.py when --changelist isn't given --- overviewer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/overviewer.py b/overviewer.py index 1188aef..b79f4dc 100755 --- a/overviewer.py +++ b/overviewer.py @@ -125,7 +125,7 @@ def main(): parser.add_option("--no-signs", dest="nosigns", action="store_true", helptext="Don't output signs to markers.js") parser.add_option("--north-direction", dest="north_direction", action="store", helptext="Specifies which corner of the screen north will point to. Defaults to whatever the current map uses, or lower-left for new maps. Valid options are: " + ", ".join(avail_north_dirs) + ".", type="choice", default="auto", choices=avail_north_dirs) parser.add_option("--changelist", dest="changelist", action="store", helptext="Output list of changed tiles to file. If the file exists, it's contents will be overwritten.",advanced=True) - parser.add_option("--changelist-format", dest="changelist_format", action="store", helptext="Output relative or absolute paths for --changelist. Only valid when --changelist is used", type="choice", default="relative", choices=["relative","absolute"],advanced=True) + parser.add_option("--changelist-format", dest="changelist_format", action="store", helptext="Output relative or absolute paths for --changelist. Only valid when --changelist is used", type="choice", default="auto", choices=["auto", "relative","absolute"],advanced=True) parser.add_option("--display-config", dest="display_config", action="store_true", helptext="Display the configuration parameters, but don't render the map. Requires all required options to be specified", commandLineOnly=True) #parser.add_option("--write-config", dest="write_config", action="store_true", helptext="Writes out a sample config file", commandLineOnly=True) @@ -287,9 +287,11 @@ dir but you forgot to put quotes around the directory, since it contains spaces. logging.error("I/O Error: %s" % e.strerror) sys.exit(1) - if options.changelist_format and not options.changelist: + if options.changelist_format != "auto" and not options.changelist: logging.error("changelist_format specified without changelist.") sys.exit(1) + if options.changelist_format == "auto": + options.changelist_format = "relative" logging.info("Welcome to Minecraft Overviewer!") logging.debug("Current log level: {0}".format(logging.getLogger().level))