import pygame except ImportError : print("This script needs PyGame to work!") print("Visit http://www.pygame.org to get it.") else : pygame.font.init() if font_name : font = pygame.font.SysFont(font_name, font_size) else : font = pygame.font.Font(font_name, font_size) print("loading files...") simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneList(Data) simutools.pruneObjs(Data, ["vehicle", "citycar"]) # remove citycars that share obj=type ! if filter_goods : print("filtering by cargo types:", " ".join(filter_goods)) simutools.pruneByParam(Data, "freight", filter_goods, filter_goods_invert) if filter_ways : print("filtering by way types:", " ".join(filter_ways)) simutools.pruneByParam(Data, "waytype", filter_ways) if filter_authors : auth_str = " ".join(filter_authors).lower() print("filtering by author names:", auth_str) i = len(Data) - 1; while i >= 0 : author = Data[i].ask("copyright", "").lower()
for l in obj.lines : f.write(l) f.close() #----- # main() is this piece of code if outsize < paksize : print("WARNING: Configuration error: Output tile size is smaller than input!") try : import pygame except ImportError : print("This script needs PyGame to work!") print("Visit http://www.pygame.org to get it.") else : pygame.font.init() font = pygame.font.Font(None, fntsize) simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneObjs(Data, ["vehicle"]) if not os.path.exists(outdir) : os.mkdir(outdir) for item in Data : procObj(item) #----- # EOF
f = open(os.path.join(outdir, cname + ".dat"), 'w') for l in obj.lines: f.write(l) f.close() #----- # main() is this piece of code try: import pygame except ImportError: print "This script needs PyGame to work!" print "Visit http://www.pygame.org to get it." else: pygame.font.init() font = pygame.font.Font(None, fntsize) simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneObjs(Data, ["building"]) if not os.path.exists(outdir): os.mkdir(outdir) for item in Data: procObj(item) #----- # EOF
import pygame except ImportError: print("This script needs PyGame to work!") print("Visit http://www.pygame.org to get it.") else: pygame.font.init() if font_name: font = pygame.font.SysFont(font_name, font_size) else: font = pygame.font.Font(font_name, font_size) print("loading files...") simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneList(Data) simutools.pruneObjs( Data, ["vehicle", "citycar"]) # remove citycars that share obj=type ! if filter_goods: print("filtering by cargo types:", " ".join(filter_goods)) simutools.pruneByParam(Data, "freight", filter_goods, filter_goods_invert) if filter_ways: print("filtering by way types:", " ".join(filter_ways)) simutools.pruneByParam(Data, "waytype", filter_ways) if filter_authors: auth_str = " ".join(filter_authors).lower() print("filtering by author names:", auth_str) i = len(Data) - 1 while i >= 0:
pygame.image.save(newimage, os.path.join(outdir, cname + ".png")) f = open(os.path.join(outdir, cname + ".dat"), 'w') for l in obj.lines : f.write(l) f.close() #----- # main() is this piece of code try : import pygame except ImportError : print "This script needs PyGame to work!" print "Visit http://www.pygame.org to get it." else : pygame.font.init() font = pygame.font.Font(None, fntsize) simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneObjs(Data, ["building"]) if not os.path.exists(outdir) : os.mkdir(outdir) for item in Data : procObj(item) #----- # EOF
#----- # main() is this piece of code if outsize < paksize: print( "WARNING: Configuration error: Output tile size is smaller than input!" ) try: import pygame except ImportError: print("This script needs PyGame to work!") print("Visit http://www.pygame.org to get it.") else: pygame.font.init() font = pygame.font.Font(None, fntsize) simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneObjs(Data, ["vehicle"]) if not os.path.exists(outdir): os.mkdir(outdir) for item in Data: procObj(item) #----- # EOF
import pygame except ImportError : print("This script needs PyGame to work!") print("Visit http://www.pygame.org to get it.") else : pygame.font.init() if font_name : font = pygame.font.SysFont(font_name, font_size) else : font = pygame.font.Font(font_name, font_size) print("loading files...") simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneList(Data) simutools.pruneObjs(Data, ["tree"]) Data.sort(objCompare) if len(Data) > 0 : print("plotting...") prepareCanvas() for i in xrange(len(Data)) : procObj(i) pygame.image.save(canvas, "climates.png") else : print("nothing found!") print("finished.") #-----
#----- # main() is this piece of code try: import pygame except ImportError: print("This script needs PyGame to work!") print("Visit http://www.pygame.org to get it.") else: pygame.display.init() simutools.walkFiles(os.getcwd(), simutools.loadFile, cbparam=Data) simutools.pruneList(Data) simutools.pruneObjs(Data, ["tree"]) if not os.path.exists(outdir): os.mkdir(outdir) screen = pygame.display.set_mode((200 + paksize, 200 + paksize)) cursor = pygame.image.load("targeting.png") cursor.set_colorkey((255, 255, 255)) for item in Data: procObj(item) #----- # EOF