having both a world/overviewer.dat and a output/overviewer.dat now warns about the world version
old behaviour was to replace the output dat with the world dat
This commit is contained in:
@@ -92,9 +92,16 @@ class World(object):
|
|||||||
# that may be needed between runs.
|
# that may be needed between runs.
|
||||||
# Currently only holds into about POIs (more more details, see quadtree)
|
# Currently only holds into about POIs (more more details, see quadtree)
|
||||||
|
|
||||||
self.pickleFile = os.path.join(self.worlddir, "overviewer.dat")
|
self.oldPickleFile = os.path.join(self.worlddir, "overviewer.dat")
|
||||||
if os.path.exists(self.pickleFile):
|
self.pickleFile = os.path.join(self.outputdir, "overviewer.dat")
|
||||||
|
|
||||||
|
if os.path.exists(self.oldPickleFile):
|
||||||
logging.warning("overviewer.dat detected in WorldDir - this is no longer the correct location")
|
logging.warning("overviewer.dat detected in WorldDir - this is no longer the correct location")
|
||||||
|
if os.path.exists(self.pickleFile):
|
||||||
|
# new file exists, so make a note of it
|
||||||
|
logging.warning("you should delete the `overviewer.dat' file in your world directory")
|
||||||
|
else:
|
||||||
|
# new file does not exist, so move the old one
|
||||||
logging.warning("Moving overviewer.dat to OutputDir")
|
logging.warning("Moving overviewer.dat to OutputDir")
|
||||||
import shutil
|
import shutil
|
||||||
try:
|
try:
|
||||||
@@ -103,13 +110,12 @@ class World(object):
|
|||||||
os.mkdir(self.outputdir)
|
os.mkdir(self.outputdir)
|
||||||
except OSError: # already exists, or failed
|
except OSError: # already exists, or failed
|
||||||
pass
|
pass
|
||||||
shutil.move(self.pickleFile, self.outputdir)
|
shutil.move(self.oldPickleFile, self.pickleFile)
|
||||||
logging.info("overviewer.dat moved")
|
logging.info("overviewer.dat moved")
|
||||||
except BaseException as ex:
|
except BaseException as ex:
|
||||||
logging.error("Unable to move overviewer.dat")
|
logging.error("Unable to move overviewer.dat")
|
||||||
logging.debug(ex.str())
|
logging.debug(ex.str())
|
||||||
|
|
||||||
self.pickleFile = os.path.join(self.outputdir, "overviewer.dat")
|
|
||||||
if os.path.exists(self.pickleFile):
|
if os.path.exists(self.pickleFile):
|
||||||
self.persistentDataIsNew = False;
|
self.persistentDataIsNew = False;
|
||||||
with open(self.pickleFile,"rb") as p:
|
with open(self.pickleFile,"rb") as p:
|
||||||
|
|||||||
Reference in New Issue
Block a user