If overviewer.dat doesn't exist, don't give a north-direction warning
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user