Ejemplo n.º 1
0
def upload():
    if not request.files:
        return jsonify({'status': 'missing'})
    try:
        data = request.files['inputCSV']
        session['uploaded_filename'] = secure_filename(data.filename)
        if data and allowed_file(data.filename):
            return jsonify_csv(data)
    except Exception:
        print sys.exc_info()[0]
        return jsonify({'status': 'failed', 'message': 'Something went wrong trying to parse your csv file.'})
Ejemplo n.º 2
0
def upload():
    if not request.files:
        return jsonify({'status': 'missing'})
    try:
        data = request.files['inputCSV']
        session['uploaded_filename'] = secure_filename(data.filename)
        if data and allowed_file(data.filename):
            return jsonify_csv(data)
    except Exception:
        print sys.exc_info()[0]
        return jsonify({
            'status':
            'failed',
            'message':
            'Something went wrong trying to parse your csv file.'
        })
Ejemplo n.º 3
0
def test_csv():
    session['uploaded_filename'] = secure_filename('testing')
    return jsonify_csv(
        open(join(abspath(dirname(__file__)), 'test/test_hat_genders.txt'),
             'r'))
Ejemplo n.º 4
0
def upload():
    data = request.files['inputCSV']
    session['uploaded_filename'] = secure_filename(data.filename)
    if data and allowed_file(data.filename):
        return jsonify_csv(data)
Ejemplo n.º 5
0
def test_csv():
    return jsonify_csv(open(join(abspath(dirname(__file__)), 'test/test_hat_standard.txt'), 'r'))
Ejemplo n.º 6
0
def upload():
    data = request.files['inputCSV']
    if data and allowed_file(data.filename):
        return jsonify_csv(data)
Ejemplo n.º 7
0
def test_csv():
    return jsonify_csv(
        open(join(abspath(dirname(__file__)), 'test/test_hat_standard.txt'),
             'r'))
Ejemplo n.º 8
0
def upload():
    data = request.files['inputCSV']
    if data and allowed_file(data.filename):
        return jsonify_csv(data)
Ejemplo n.º 9
0
def test_csv():
    session['uploaded_filename'] = secure_filename('testing')
    return jsonify_csv(open(join(abspath(dirname(__file__)), 'test/test_hat_genders.txt'), 'r'))
Ejemplo n.º 10
0
def upload():
    data = request.files['inputCSV']
    session['uploaded_filename'] = secure_filename(data.filename)
    if data and allowed_file(data.filename):
        return jsonify_csv(data)