Esempio n. 1
0
def show_rate_limit():
    body, status_code, response_headers = get_rate_limit()
    rl = json.loads(body)
    if g.user:
        rl.update({"user": session.get("username")})
    else:
        rl.update({"user": "******"})
    # The "rate" hash (shown at the bottom of the response above) is
    # deprecated and is scheduled for removal in the next version of the API.
    # see https://developer.github.com/v3/rate_limit/
    if "rate" in rl:
        rl.pop("rate")
    return (render_template("ratelimit.txt", rl=rl), 200, {"content-type": "text/plain"})
Esempio n. 2
0
def show_rate_limit():
    rl = json.loads(get_rate_limit())
    if g.user:
        rl.update({"user": session.get('username')})
    else:
        rl.update({"user": "******"})
    # The "rate" hash (shown at the bottom of the response above) is
    # deprecated and is scheduled for removal in the next version of the API.
    # see https://developer.github.com/v3/rate_limit/
    if "rate" in rl:
        rl.pop("rate")
    return (render_template('ratelimit.txt', rl=rl), 200,
            {"content-type": "text/plain"})