예제 #1
0
파일: views.py 프로젝트: Hernrup/KittyBot
def show_qr_code_from_data():
    data = request.args['data']
    log.debug('QR code requested for: {}'.format(data))
    image = qr.generate_qr_image(data)
    response = make_response(image)
    response.headers['Content-Type'] = 'image/svg+xml'
    return response
예제 #2
0
def show_qr_code_from_data():
    data = request.args['data']
    log.debug('QR code requested for: {}'.format(data))
    image = qr.generate_qr_image(data)
    response = make_response(image)
    response.headers['Content-Type'] = 'image/svg+xml'
    return response
예제 #3
0
파일: views.py 프로젝트: Hernrup/KittyBot
def show_system_qrcode():
    base_url = app.external_uri if app.external_uri else request.host_url
    data = '{}/v1/input/'.format(base_url)
    log.debug('Connect QR code requested for: {}'.format(data))
    image = qr.generate_qr_image(data)
    response = make_response(image)
    response.headers['Content-Type'] = 'image/svg+xml'
    return response
예제 #4
0
파일: views.py 프로젝트: Hernrup/KittyBot
def show_sl4a_qrcode():
    with open(path.abspath(path.join('sl4a', 'QR-IO.py')), "r") as f:
        data = f.readlines()
    base_url = app.external_uri if app.external_uri else request.host_url
    log.debug('sl4a QR code requested')
    image = qr.generate_qr_image(data, error='L')
    response = make_response(image)
    response.headers['Content-Type'] = 'image/svg+xml'
    return response
예제 #5
0
def show_sl4a_qrcode():
    with open(path.abspath(path.join('sl4a', 'QR-IO.py')), "r") as f:
        data = f.readlines()
    base_url = app.external_uri if app.external_uri else request.host_url
    log.debug('sl4a QR code requested')
    image = qr.generate_qr_image(data, error='L')
    response = make_response(image)
    response.headers['Content-Type'] = 'image/svg+xml'
    return response
예제 #6
0
def show_system_qrcode():
    base_url = 'http://'+app.external_uri+'/' if app.external_uri \
        else request.host_url
    data = '{}v1/input/'.format(base_url)
    log.debug('Connect QR code requested for: {}'.format(data))
    image = qr.generate_qr_image(data)
    response = make_response(image)
    response.headers['Content-Type'] = 'image/svg+xml'
    return response