예제 #1
0
파일: base.py 프로젝트: chos9/sagenb
def keyboard_js(browser_os):
    from sagenb.notebook.keyboards import get_keyboard
    data = get_keyboard(browser_os)
    datahash=sha1(data).hexdigest()
    if request.environ.get('HTTP_IF_NONE_MATCH', None) == datahash:
        response = make_response('',304)
    else:
        response = make_response(data)
        response.headers['Content-Type'] = 'text/javascript; charset=utf-8'
        response.headers['Etag']=datahash
    return response
예제 #2
0
파일: base.py 프로젝트: sangkyunyoon/sagenb
def keyboard_js(browser_os):
    from sagenb.notebook.keyboards import get_keyboard
    data = get_keyboard(browser_os)
    datahash = sha1(data).hexdigest()
    if request.environ.get('HTTP_IF_NONE_MATCH', None) == datahash:
        response = make_response('', 304)
    else:
        response = make_response(data)
        response.headers['Content-Type'] = 'text/javascript; charset=utf-8'
        response.headers['Etag'] = datahash
    return response
예제 #3
0
def keyboard_js(browser_os):
    from sagenb.notebook.keyboards import get_keyboard
    response = make_response(get_keyboard(browser_os))
    response.headers['Content-Type'] = 'text/javascript; charset=utf-8'
    return response