Browse Source

working on leveldb issues

was broken in minetestmapper-numpy
master
poikilos 9 years ago
committed by Jacob Gustafson
parent
commit
4bfc9afece
  1. 2
      minetestmapper-expertmm.py
  2. 3
      minetestmapper-numpy.py

2
minetestmapper-expertmm.py

@ -375,7 +375,7 @@ if os.path.exists(path + "sectors"):
zlist.append(z) zlist.append(z)
if len(xlist) == 0 or len(zlist) == 0: if len(xlist) == 0 or len(zlist) == 0:
print("At this location, data does not exist.") print("At this location data does not exist.")
sys.exit(1) sys.exit(1)
# Get rid of doubles # Get rid of doubles

3
minetestmapper-numpy.py

@ -464,8 +464,11 @@ class LVLDB:
def __iter__(self): def __iter__(self):
for k in self.conn.RangeIter(): for k in self.conn.RangeIter():
if k is not None and len(k)>0:
x, y, z = getIntegerAsBlock(int(k[0])) x, y, z = getIntegerAsBlock(int(k[0]))
yield x, y, z, k[0] yield x, y, z, k[0]
else:
print("WARNING: no data at first index in value '"+str(k))
def get(self, pos): def get(self, pos):
return BytesIO(self.conn.Get(pos)) return BytesIO(self.conn.Get(pos))

Loading…
Cancel
Save