0

Remove SizeOnDisk from table of detected worlds

This fields hasn't been properly filled in for many many releases.
We could detect this value some other way, but i'm not sure the value in
doing this
This commit is contained in:
Andrew Chin
2014-02-21 22:23:25 -05:00
parent d9e907913e
commit 65d6e3bcd1

View File

@@ -528,9 +528,9 @@ def list_worlds():
# get max length of world name # get max length of world name
worldNameLen = max([len(x) for x in worlds] + [len("World")]) worldNameLen = max([len(x) for x in worlds] + [len("World")])
formatString = "%-" + str(worldNameLen) + "s | %-8s | %-8s | %-16s | %s " formatString = "%-" + str(worldNameLen) + "s | %-8s | %-16s | %s "
print(formatString % ("World", "Size", "Playtime", "Modified", "Path")) print(formatString % ("World", "Playtime", "Modified", "Path"))
print(formatString % ("-"*worldNameLen, "-"*8, "-"*8, '-'*16, '-'*4)) print(formatString % ("-"*worldNameLen, "-"*8, '-'*16, '-'*4))
for name, info in sorted(worlds.iteritems()): for name, info in sorted(worlds.iteritems()):
if isinstance(name, basestring) and name.startswith("World") and len(name) == 6: if isinstance(name, basestring) and name.startswith("World") and len(name) == 6:
try: try:
@@ -544,9 +544,8 @@ def list_worlds():
time.localtime(info['LastPlayed'] / 1000)) time.localtime(info['LastPlayed'] / 1000))
playtime = info['Time'] / 20 playtime = info['Time'] / 20
playstamp = '%d:%02d' % (playtime / 3600, playtime / 60 % 60) playstamp = '%d:%02d' % (playtime / 3600, playtime / 60 % 60)
size = "%.2fMB" % (info['SizeOnDisk'] / 1024. / 1024.)
path = info['path'] path = info['path']
print(formatString % (name, size, playstamp, timestamp, path)) print(formatString % (name, playstamp, timestamp, path))
if __name__ == "__main__": if __name__ == "__main__":
multiprocessing.freeze_support() multiprocessing.freeze_support()