From cd360c3c60e16b16cec9eb28244a4eab1e911a96 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Sun, 20 Nov 2011 10:52:04 -0500 Subject: [PATCH] comments adjustment in nbt.py --- overviewer_core/nbt.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/overviewer_core/nbt.py b/overviewer_core/nbt.py index ef8536a..97160a0 100644 --- a/overviewer_core/nbt.py +++ b/overviewer_core/nbt.py @@ -16,11 +16,11 @@ import gzip, zlib import struct import StringIO -import os import numpy from functools import wraps -# decorator to handle filename or object as first parameter +# decorator that turns the first argument from a string into an open file +# handle def _file_loader(func): @wraps(func) def wrapper(fileobj, *args): @@ -32,6 +32,10 @@ def _file_loader(func): @_file_loader def load(fileobj): + """Reads in the given file as NBT format, parses it, and returns the + result + + """ return NBTFileReader(fileobj).read_all() def load_from_region(filename, x, y, north_direction): @@ -59,6 +63,9 @@ _unsigned_int = struct.Struct(">I") _chunk_header = struct.Struct(">I B") class NBTFileReader(object): + """Low level class that reads the Named Binary Tag format used by Minecraft + + """ def __init__(self, fileobj, is_gzip=True): if is_gzip: self._file = gzip.GzipFile(fileobj=fileobj, mode='rb')