def processOv2(): try: data = json.loads(request.data) name = data['name'] bin = base64.decodestring(data['bin'][12:]) if not bin[0] in '\x00\x01\x02\x03': raise Exception("Corrupted OV2 file.") id, name, pois = datastore.create_container(name = name, poi_bin_string = bin) return {'id': id, 'name': name, 'content': pois} except Exception: print traceback.format_exc() abort(500)
def createPoiContainer(): id, name, pois = datastore.create_container() return {'id': id, 'name': name, 'content': pois}