Exemple #1
0
def _set_weights():
    data = request.args
    lang = data.get('lang', None)
    weights = data.get('weights')
    session = data.get('session')
    ret, response = set_weights(weights, lang, session)
    return Response(json_encode({'ret': ret, 'response': response}),
        mimetype="application/json")
Exemple #2
0
def _set_weights():
    data = request.args
    lang = data.get('lang', None)
    weights = data.get('weights')
    session = data.get('session')
    ret, response = set_weights(weights, lang, session)
    return Response(json_encode({
        'ret': ret,
        'response': response
    }),
                    mimetype="application/json")
Exemple #3
0
def _set_weights():
    data = request.args
    lang = data.get('lang', None)
    param = data.get('param')
    sid = data.get('session')
    ret, response = set_weights(param, lang, sid)
    if ret:
        sess = session_manager.get_session(sid)
        if sess and hasattr(sess.session_context, 'weights'):
            logger.info("Set weights {} successfully".format(sess.session_context.weights))
    else:
        logger.info("Set weights failed.")
    return Response(json_encode({'ret': ret, 'response': response}),
                    mimetype="application/json")
Exemple #4
0
def _set_weights():
    data = request.args
    lang = data.get('lang', None)
    param = data.get('param')
    sid = data.get('session')
    ret, response = set_weights(param, lang, sid)
    if ret:
        sess = session_manager.get_session(sid)
        if sess and hasattr(sess.sdata, 'weights'):
            logger.info("Set weights {} successfully".format(sess.sdata.weights))
    else:
        logger.info("Set weights failed.")
    return Response(json_encode({'ret': ret, 'response': response}),
                    mimetype="application/json")