remove extra parenthesis probably from 2to3
parent
5b6db13152
commit
f2e733bded
|
@ -574,7 +574,7 @@ class SQLDB:
|
||||||
self.cur.execute("SELECT `pos` FROM `blocks`")
|
self.cur.execute("SELECT `pos` FROM `blocks`")
|
||||||
while True:
|
while True:
|
||||||
r = self.cur.fetchone()
|
r = self.cur.fetchone()
|
||||||
print(("getting int from first index of value "+str(r)))
|
print("getting int from first index of value "+str(r))
|
||||||
if not r:
|
if not r:
|
||||||
break
|
break
|
||||||
x, y, z = getIntegerAsBlock(r[0])
|
x, y, z = getIntegerAsBlock(r[0])
|
||||||
|
@ -1127,8 +1127,8 @@ def draw_image(world, uid_to_color):
|
||||||
ugstrength = (ugstrength - (ugstrength - 0.75)
|
ugstrength = (ugstrength - (ugstrength - 0.75)
|
||||||
* (ugstrength > 0.75))
|
* (ugstrength > 0.75))
|
||||||
ugstrength = ugstrength[:, :, numpy.newaxis]
|
ugstrength = ugstrength[:, :, numpy.newaxis]
|
||||||
print(('ugmin', stuff['undergroundh'].min()))
|
print('ugmin', stuff['undergroundh'].min())
|
||||||
print(('ugmax', stuff['undergroundh'].max()))
|
print('ugmax', stuff['undergroundh'].max())
|
||||||
ugdepth = (
|
ugdepth = (
|
||||||
1.0 * (stuff['undergroundh']-stuff['undergroundh'].min())
|
1.0 * (stuff['undergroundh']-stuff['undergroundh'].min())
|
||||||
/ (stuff['undergroundh'].max()-stuff['undergroundh'].min())
|
/ (stuff['undergroundh'].max()-stuff['undergroundh'].min())
|
||||||
|
@ -1305,10 +1305,10 @@ def draw_image(world, uid_to_color):
|
||||||
p = line.split()
|
p = line.split()
|
||||||
if p[0] == "name":
|
if p[0] == "name":
|
||||||
name = p[2]
|
name = p[2]
|
||||||
print((filename + ": name = " + name))
|
print(filename + ": name = " + name)
|
||||||
if p[0] == "position":
|
if p[0] == "position":
|
||||||
position = p[2][1:-1].split(",")
|
position = p[2][1:-1].split(",")
|
||||||
print((filename + ": position = " + p[2]))
|
print(filename + ": position = " + p[2])
|
||||||
if len(name) < 0 and len(position) == 3:
|
if len(name) < 0 and len(position) == 3:
|
||||||
x, y, z = [int(float(p)/10) for p in position]
|
x, y, z = [int(float(p)/10) for p in position]
|
||||||
x, y, z = world.facing(x, y, z)
|
x, y, z = world.facing(x, y, z)
|
||||||
|
@ -1347,12 +1347,12 @@ def draw_image(world, uid_to_color):
|
||||||
pngmaxz = maxz*16+16
|
pngmaxz = maxz*16+16
|
||||||
pngregion = [pngminx, pngmaxx, pngminz, pngmaxz]
|
pngregion = [pngminx, pngmaxx, pngminz, pngmaxz]
|
||||||
|
|
||||||
print(("Saving to: " + args.output))
|
print("Saving to: " + args.output)
|
||||||
print(("PNG Region: ", pngregion))
|
print("PNG Region: ", pngregion)
|
||||||
print(("pngMinX: ", str(pngminx)))
|
print("pngMinX: ", str(pngminx))
|
||||||
print(("pngMaxZ: ", str(pngmaxz)))
|
print("pngMaxZ: ", str(pngmaxz))
|
||||||
print(("Pixels PerNode: ", args.pixelspernode))
|
print("Pixels PerNode: ", args.pixelspernode)
|
||||||
print(("border: ", border))
|
print("border: ", border)
|
||||||
|
|
||||||
# This saves data in tEXt chunks (non-standard naming tags are
|
# This saves data in tEXt chunks (non-standard naming tags are
|
||||||
# allowed according to the PNG specification)
|
# allowed according to the PNG specification)
|
||||||
|
|
|
@ -182,7 +182,7 @@ try:
|
||||||
"region="])
|
"region="])
|
||||||
except getopt.GetoptError as err:
|
except getopt.GetoptError as err:
|
||||||
# print help information and exit:
|
# print help information and exit:
|
||||||
print((str(err))) # will print something like "option -a not recognized"
|
print(str(err)) # something like "option -a not recognized"
|
||||||
usage()
|
usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
@ -230,21 +230,21 @@ for o, a in opts:
|
||||||
elif o == "--region":
|
elif o == "--region":
|
||||||
region_string = a
|
region_string = a
|
||||||
elif o == "--drawalpha":
|
elif o == "--drawalpha":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
elif o == "--noshading":
|
elif o == "--noshading":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
elif o == "--min-y":
|
elif o == "--min-y":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
elif o == "--max-y":
|
elif o == "--max-y":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
elif o == "--backend":
|
elif o == "--backend":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
elif o == "--zoom":
|
elif o == "--zoom":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
elif o == "--colors":
|
elif o == "--colors":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
elif o == "--scales":
|
elif o == "--scales":
|
||||||
print(("# ignored (NOT YET IMPLEMENTED) " + o))
|
print("# ignored (NOT YET IMPLEMENTED) " + o)
|
||||||
else:
|
else:
|
||||||
assert False, "unhandled option"
|
assert False, "unhandled option"
|
||||||
|
|
||||||
|
@ -277,13 +277,14 @@ if geometry_string is not None:
|
||||||
+ " zmin:" + str(nonchunky_zmin) + "\n"
|
+ " zmin:" + str(nonchunky_zmin) + "\n"
|
||||||
+ " zmax:" + str(nonchunky_zmax))
|
+ " zmax:" + str(nonchunky_zmax))
|
||||||
else:
|
else:
|
||||||
print(("ERROR: Missing coordinates in '" + geometry_string +
|
print("ERROR: Missing coordinates in '" + geometry_string
|
||||||
"' for geometry (must be in the form: x:z+width+height)"))
|
+ "' for geometry (must be in the form:"
|
||||||
|
+ " x:z+width+height)")
|
||||||
usage()
|
usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
else:
|
else:
|
||||||
print(("ERROR: Incorrect geometry syntax '" + geometry_string +
|
print("ERROR: Incorrect geometry syntax '" + geometry_string
|
||||||
"' (must be in the form: x:z+width+height)"))
|
+ "' (must be in the form: x:z+width+height)")
|
||||||
usage()
|
usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
elif region_string is not None:
|
elif region_string is not None:
|
||||||
|
@ -304,8 +305,9 @@ elif region_string is not None:
|
||||||
+ " zmin:" + str(nonchunky_zmin) + "\n"
|
+ " zmin:" + str(nonchunky_zmin) + "\n"
|
||||||
+ " zmax:" + str(nonchunky_zmax))
|
+ " zmax:" + str(nonchunky_zmax))
|
||||||
else:
|
else:
|
||||||
print(("ERROR: Incorrect value '" + region_string +
|
print("ERROR: Incorrect value '" + region_string
|
||||||
"' for region (must be in the form: xmin:xmax,zmin:zmax)"))
|
+ "' for region (must be in the form:"
|
||||||
|
+ " xmin:xmax,zmin:zmax)")
|
||||||
usage()
|
usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
@ -451,8 +453,8 @@ maxz = max(zlist)
|
||||||
w = (maxx - minx) * 16 + 16
|
w = (maxx - minx) * 16 + 16
|
||||||
h = (maxz - minz) * 16 + 16
|
h = (maxz - minz) * 16 + 16
|
||||||
|
|
||||||
print(("Result image (w=" + str(w) + " h=" + str(h) + ") will be written to " +
|
print("Result image (w=" + str(w) + " h=" + str(h)
|
||||||
output))
|
+ ") will be written to " + output)
|
||||||
|
|
||||||
im = Image.new("RGB", (w + border, h + border), bgcolor)
|
im = Image.new("RGB", (w + border, h + border), bgcolor)
|
||||||
draw = ImageDraw.Draw(im)
|
draw = ImageDraw.Draw(im)
|
||||||
|
@ -501,8 +503,8 @@ def read_mapdata(mapdata, version, pixellist, water, day_night_differs,
|
||||||
global unknown_node_ids
|
global unknown_node_ids
|
||||||
|
|
||||||
if(len(mapdata) < 4096):
|
if(len(mapdata) < 4096):
|
||||||
print(("bad: " + xhex + "/" + zhex + "/" + yhex + " " +
|
print("bad: " + xhex + "/" + zhex + "/" + yhex + " " +
|
||||||
str(len(mapdata))))
|
str(len(mapdata)))
|
||||||
else:
|
else:
|
||||||
chunkxpos = xpos * 16
|
chunkxpos = xpos * 16
|
||||||
chunkypos = ypos * 16
|
chunkypos = ypos * 16
|
||||||
|
@ -966,10 +968,10 @@ if drawplayers:
|
||||||
p = line.split()
|
p = line.split()
|
||||||
if p[0] == "name":
|
if p[0] == "name":
|
||||||
name = p[2]
|
name = p[2]
|
||||||
print((filename + ": name = " + name))
|
print(filename + ": name = " + name)
|
||||||
if p[0] == "position":
|
if p[0] == "position":
|
||||||
position = p[2][1:-1].split(",")
|
position = p[2][1:-1].split(",")
|
||||||
print((filename + ": position = " + p[2]))
|
print(filename + ": position = " + p[2])
|
||||||
if len(name) > 0 and len(position) == 3:
|
if len(name) > 0 and len(position) == 3:
|
||||||
x = (int(float(position[0]) / 10 - minx * 16))
|
x = (int(float(position[0]) / 10 - minx * 16))
|
||||||
z = int(h - (float(position[2]) / 10 - minz * 16))
|
z = int(h - (float(position[2]) / 10 - minz * 16))
|
||||||
|
|
|
@ -76,7 +76,7 @@ def getSectorPos(dirname):
|
||||||
x = parseSigned12bit(dirname[:3])
|
x = parseSigned12bit(dirname[:3])
|
||||||
z = parseSigned12bit(dirname[4:])
|
z = parseSigned12bit(dirname[4:])
|
||||||
else:
|
else:
|
||||||
print(('Terrible sector at ' + dirname))
|
print('Terrible sector at ' + dirname)
|
||||||
return
|
return
|
||||||
|
|
||||||
return x, z
|
return x, z
|
||||||
|
@ -89,7 +89,7 @@ def getBlockPos(sectordir, blockfile):
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(blockfile) != 4:
|
if len(blockfile) != 4:
|
||||||
print(("Invalid block filename: " + blockfile))
|
print("Invalid block filename: " + blockfile)
|
||||||
|
|
||||||
y = parseSigned16bit(blockfile)
|
y = parseSigned16bit(blockfile)
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ cur = conn.cursor()
|
||||||
if create:
|
if create:
|
||||||
cur.execute("CREATE TABLE IF NOT EXISTS `blocks` (`pos` INT NOT NULL PRIMARY KEY, `data` BLOB);")
|
cur.execute("CREATE TABLE IF NOT EXISTS `blocks` (`pos` INT NOT NULL PRIMARY KEY, `data` BLOB);")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
print(('Created database at ' + path + 'map.sqlite'))
|
print('Created database at ' + path + 'map.sqlite')
|
||||||
|
|
||||||
# Crawl the folders
|
# Crawl the folders
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ for base in paths:
|
||||||
elif base == 'sectors2':
|
elif base == 'sectors2':
|
||||||
v= 2
|
v= 2
|
||||||
else:
|
else:
|
||||||
print(('Ignoring base ' + base))
|
print('Ignoring base ' + base)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for root, dirs, files in os.walk(path + base):
|
for root, dirs, files in os.walk(path + base):
|
||||||
|
@ -137,7 +137,7 @@ for base in paths:
|
||||||
pos = getBlockAsInteger(getBlockPos(root[(-8 if v == 1 else -7 if v == 2 else 0):], block))
|
pos = getBlockAsInteger(getBlockPos(root[(-8 if v == 1 else -7 if v == 2 else 0):], block))
|
||||||
|
|
||||||
if pos is None:
|
if pos is None:
|
||||||
print(('Ignoring broken path ' + root + '/' + block))
|
print('Ignoring broken path ' + root + '/' + block)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
f = open(root+'/'+block, 'rb')
|
f = open(root+'/'+block, 'rb')
|
||||||
|
@ -152,7 +152,7 @@ for base in paths:
|
||||||
|
|
||||||
if(time.time() - t > 3):
|
if(time.time() - t > 3):
|
||||||
t = time.time()
|
t = time.time()
|
||||||
print((str(count)+' blocks processed...'))
|
print(str(count)+' blocks processed...')
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue