Skip to content

Commit

Permalink
move oauthlib logging and webob.exc 429 configs here from https://git…
Browse files Browse the repository at this point in the history
  • Loading branch information
snarfed committed Nov 3, 2015
1 parent 1eb6c68 commit c0010f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions oauth_dropins/appengine_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

from webutil.appengine_config import *

# quiet down oauth1 log messages
import logging
logging.getLogger('oauthlib').setLevel(logging.INFO)
logging.getLogger('requests_oauthlib').setLevel(logging.INFO)

# default timeout. the G+ and Instagram APIs use httplib2, which honors this.
import socket
socket.setdefaulttimeout(HTTP_TIMEOUT)
Expand All @@ -40,6 +45,10 @@
# http://stackoverflow.com/a/8465202/186123
socket.getdefaulttimeout = lambda: HTTP_TIMEOUT

# Twitter returns HTTP 429 for rate limiting, which webob doesn't know. Tell it.
import webob
webob.util.status_reasons[429] = 'Twitter rate limited'


def read(filename):
"""Returns the contents of filename, or None if it doesn't exist."""
Expand Down
2 changes: 1 addition & 1 deletion oauth_dropins/webutil
Submodule webutil updated 3 files
+70 −0 appengine_config.py
+5 −2 testutil.py
+3 −0 util.py

0 comments on commit c0010f8

Please sign in to comment.