From 01bba80c543974aa125d717caf32c57736805154 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Wed, 17 Aug 2011 20:04:25 -0400 Subject: [PATCH] If overviewer.dat doesn't exist, don't give a north-direction warning --- overviewer.py | 2 +- overviewer_core/world.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/overviewer.py b/overviewer.py index de0cc57..6743293 100755 --- a/overviewer.py +++ b/overviewer.py @@ -244,7 +244,7 @@ def main(): if north_direction == 'auto': north_direction = w.persistentData['north_direction'] options.north_direction = north_direction - elif w.persistentData['north_direction'] != north_direction and not options.forcerender: + elif w.persistentData['north_direction'] != north_direction and not options.forcerender and not w.persistentDataIsNew: logging.error("Conflicting north-direction setting!") logging.error("Overviewer.dat gives previous north-direction as "+w.persistentData['north_direction']) logging.error("Requested north-direction was "+north_direction) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 0845b0a..c52008d 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -111,6 +111,7 @@ class World(object): self.pickleFile = os.path.join(self.outputdir, "overviewer.dat") if os.path.exists(self.pickleFile): + self.persistentDataIsNew = False; with open(self.pickleFile,"rb") as p: self.persistentData = cPickle.load(p) if not self.persistentData.get('north_direction', False): @@ -119,6 +120,7 @@ class World(object): else: # some defaults, presumably a new map self.persistentData = dict(POI=[], north_direction='lower-left') + self.persistentDataIsNew = True # indicates that the values in persistentData are new defaults, and it's OK to override them # handle 'auto' north if self.north_direction == 'auto':