Ejemplo n.º 1
0
def all(username=None):
    if not username:
        username = flask.session['shown_user']['username']

    if not search.is_current(username, "checkin"):
        search.index("checkin", untappd.get_checkins(username))
        search.update_last_indexed(username, "checkin")

    return search.search("checkin", {"term": {"user.user_name": username}})
Ejemplo n.º 2
0
def dev_stub(user):
    if app.config["UNTAPPD_STUB"]:
        return "Unable to update stubs because Untapped is in stubbed mode."

    user_dir = join("stub", user)

    if not exists(user_dir):
        mkdir(user_dir)

    with open(join(user_dir, "checkin.json"), "w") as f:
        json.dump(untappd.get_checkins(user), f, indent=True)
    with open(join(user_dir, "friend_list.json"), "w") as f:
        json.dump(untappd.get_user_friends(user), f, indent=True)
    with open(join(user_dir, "user_info.json"), "w") as f:
        json.dump(untappd.get_user_info(user), f, indent=True)

    return 'Updated stub for user "%s".' % user
Ejemplo n.º 3
0
def dev_stub(user):
    if app.config["UNTAPPD_STUB"]:
        return "Unable to update stubs because Untapped is in stubbed mode."

    user_dir = join('stub', user)

    if not exists(user_dir):
        mkdir(user_dir)

    with open(join(user_dir, 'checkin.json'), 'w') as f:
        json.dump(untappd.get_checkins(user), f, indent=True)
    with open(join(user_dir, 'friend_list.json'), 'w') as f:
        json.dump(untappd.get_user_friends(user), f, indent=True)
    with open(join(user_dir, 'user_info.json'), 'w') as f:
        json.dump(untappd.get_user_info(user), f, indent=True)

    return 'Updated stub for user "%s".' % user