def saveMap(): print "starting..." m = mapRecords() m.mapId = randint(0,5) m.width = randint(0, 200) m.height = randint(0, 200) m.scaling = random()*10 m.offsetX = randint(0, 12) m.offsetY = randint(0, 12) m.updateTime = datetime.datetime.now() m.image.put(get_random_map(), content_type= 'image/jpg') try: m.save() print m.id print "wuploaded!!" except Exception,e: print e
def saveMap(): print "starting..." m = mapRecords() m.mapId = randint(0, 5) m.width = randint(0, 200) m.height = randint(0, 200) m.scaling = random() * 10 m.offsetX = randint(0, 12) m.offsetY = randint(0, 12) m.updateTime = datetime.datetime.now() m.image.put(get_random_map(), content_type='image/jpg') try: m.save() print m.id print "wuploaded!!" except Exception, e: print e
def generate_save_map(self, total): for i in range(0, total): m = mapRecords() m.mapId = randint(0, total) m.receiverId = randint(0, 5) m.width = randint(0, 200) m.height = randint(0, 200) m.scalingX = random() * 10 m.scalingY = random() * 10 m.offsetX = randint(0, total) m.offsetY = randint(0, total) m.updateTime = datetime.datetime.now() try: m.save() pass except Exception, e: print e
def generate_save_map(self, total): for i in range(0, total): m = mapRecords() m.mapId = randint(0, total) m.receiverId = randint(0, 5) m.width = randint(0, 200) m.height = randint(0, 200) m.scalingX = random()*10 m.scalingY = random()*10 m.offsetX = randint(0, total) m.offsetY = randint(0, total) m.updateTime = datetime.datetime.now() try: m.save() pass except Exception, e: print e