0

add proper title to generated html

This commit is contained in:
Alex Headley
2011-12-07 11:17:39 -05:00
parent 55b6ba32ee
commit 350cc70749
3 changed files with 9 additions and 0 deletions

View File

@@ -2,6 +2,8 @@
<html>
<head>
<title>{title}</title>
<meta name="generator" content="Minecraft-Overviewer {version}" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

View File

@@ -154,6 +154,7 @@ class MapGen(object):
indexpath = os.path.join(self.destdir, "index.html")
index = open(indexpath, 'r').read()
index = index.replace("{title}", "Minecraft Overviewer: %s" % self.world.name)
index = index.replace("{time}", str(strftime("%a, %d %b %Y %H:%M:%S %Z", localtime())))
versionstr = "%s (%s)" % (overviewer_version.VERSION, overviewer_version.HASH[:7])
index = index.replace("{version}", versionstr)

View File

@@ -81,6 +81,12 @@ class World(object):
if not ('version' in data and data['version'] == 19132):
logging.error("Sorry, This version of Minecraft-Overviewer only works with the new McRegion chunk format")
sys.exit(1)
if 'LevelName' in data:
# level.dat should have the LevelName attribute so we'll use that
self.name = data['LevelName']
else:
# but very old ones might not? so we'll just go with the world dir name if they don't
self.name = os.path.basename(os.path.realpath(self.worlddir))
# stores Points Of Interest to be mapped with markers
# a list of dictionaries, see below for an example