Ejemplo n.º 1
0
def _json(action):
    return jsonify(dispatch_action(request.values, action))
Ejemplo n.º 2
0
Archivo: index.py Proyecto: lhysrc/me
def _json(action):
    return jsonify(dispatch_action(request.values, action))
Ejemplo n.º 3
0
        result = {}
        try:
            blob_infos = get_blob_info_list(request)
            if not blob_infos:
                raise Exception("can not get blob info")

            photos = [apis.Photo.create_photo_with_url(**info) for info in blob_infos]
            result["status"] = "ok"
            result["photos"] = photos
        except Exception, e:
            from settings import logging
            logging.exception("error in upload_handler:")
            result["error"] = unicode(e)
            result["status"] = "error"

        return jsonify(result)


########################################
## Start Application
########################################
if RUNTIME_ENV == "bae":
    from bae.core.wsgi import WSGIApplication
    application = WSGIApplication(app)

elif RUNTIME_ENV == "sae":
    import sae
    application = sae.create_wsgi_app(app)

elif RUNTIME_ENV == "local":
    application = app
Ejemplo n.º 4
0
Archivo: index.py Proyecto: lhysrc/me
            blob_infos = get_blob_info_list(request)
            if not blob_infos:
                raise Exception("can not get blob info")

            photos = [
                apis.Photo.create_photo_with_url(**info) for info in blob_infos
            ]
            result["status"] = "ok"
            result["photos"] = photos
        except Exception, e:
            from settings import logging
            logging.exception("error in upload_handler:")
            result["error"] = unicode(e)
            result["status"] = "error"

        return jsonify(result)


from weixin.WeiXin import echo

########################################
## Start Application
########################################
if RUNTIME_ENV == "bae":
    from bae.core.wsgi import WSGIApplication
    application = WSGIApplication(app)

elif RUNTIME_ENV == "sae":
    import sae
    application = sae.create_wsgi_app(app)