def user_status(uid):
    logs = fetch_uid_location_data(uid)
    results = merge_locations(logs)
    get_delta(results)
    moves = get_moves(results)
    stops = get_stop(results)
    return make_response(dumps(get_status(moves, stops)))
Beispiel #2
0
def user_status(uid):
    logs = fetch_uid_location_data(uid)
    results = merge_locations(logs)
    get_delta(results)
    moves = get_moves(results)
    stops = get_stop(results)
    return make_response(dumps(get_status(moves, stops)))
def run(outputfile):
    cols = ['uid', 'data']
    f = open(outputfile, 'w')
    writer = DictWriter(f, cols)
    writer.writeheader()
    db = DB(dbconfig)

    for uid in fetch_users(db):
        logs = fetch_user_location_logs(uid, db)
        results = merge_locations(logs)
        get_delta(results)
        moves = get_moves(results)
        stops = get_stop(results)
        user_status = generate_status_matrix(moves, stops)
        writer.writerow({'uid': uid, 'data': json.dumps(user_status)})
def run(outputfile):
    cols = ['uid', 'data']
    f = open(outputfile, 'w')
    writer = DictWriter(f, cols)
    writer.writeheader()
    db = DB(dbconfig)

    for uid in fetch_users(db):
        logs = fetch_user_location_logs(uid, db)
        results = merge_locations(logs)
        get_delta(results)
        moves = get_moves(results)
        stops = get_stop(results)
        user_status = generate_status_matrix(moves, stops)
        writer.writerow({
            'uid': uid,
            'data': json.dumps(user_status)
        })