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