Re-naming
This commit is contained in:
@@ -36,7 +36,7 @@ from . import packages
|
||||
from .packages import praw
|
||||
from .config import Config, copy_default_config, copy_default_mailcap
|
||||
from .theme import Theme
|
||||
from .oauth import OAuthHelper, OAuthRateLimitHandler
|
||||
from .oauth import OAuthHelper, OAuthRateLimiter
|
||||
from .terminal import Terminal
|
||||
from .objects import curses_session, patch_webbrowser
|
||||
from .subreddit_page import SubredditPage
|
||||
@@ -174,11 +174,10 @@ def main():
|
||||
term = Terminal(stdscr, config, theme)
|
||||
|
||||
with term.loader('Initializing', catch_exception=False):
|
||||
handler = OAuthRateLimitHandler()
|
||||
reddit = praw.Reddit(user_agent=user_agent,
|
||||
decode_html_entities=False,
|
||||
disable_update_check=True,
|
||||
handler=handler)
|
||||
handler=OAuthRateLimiter())
|
||||
|
||||
# Authorize on launch if the refresh token is present
|
||||
oauth = OAuthHelper(reddit, term, config)
|
||||
|
||||
@@ -231,6 +231,12 @@ class OAuthHelper(object):
|
||||
|
||||
|
||||
def fix_cache(func):
|
||||
"""
|
||||
This is a shim around PRAW's 30 second page cache that attempts
|
||||
to address broken behavior that hasn't been fixed because PRAW 3
|
||||
is deprecated.
|
||||
"""
|
||||
|
||||
def wraps(self, _cache_key, _cache_ignore, *args, **kwargs):
|
||||
if _cache_key:
|
||||
# Pop the request's session cookies from the cache key.
|
||||
@@ -249,7 +255,7 @@ def fix_cache(func):
|
||||
return wraps
|
||||
|
||||
|
||||
class OAuthRateLimitHandler(DefaultHandler):
|
||||
class OAuthRateLimiter(DefaultHandler):
|
||||
"""Custom PRAW request handler for rate-limiting requests.
|
||||
|
||||
This is an alternative to PRAW 3's DefaultHandler that uses
|
||||
|
||||
Reference in New Issue
Block a user