From: Harmon Date: Fri, 7 Jan 2022 14:14:36 +0000 (-0600) Subject: Improve order of OAuth1UserHandler methods X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=77531a4f3ebfe5e2f760da156f88377462dab67d;p=tweepy.git Improve order of OAuth1UserHandler methods --- diff --git a/tweepy/auth.py b/tweepy/auth.py index 120e28f..970c32c 100644 --- a/tweepy/auth.py +++ b/tweepy/auth.py @@ -44,9 +44,6 @@ class OAuth1UserHandler: client_secret=consumer_secret, callback_uri=self.callback) - def _get_oauth_url(self, endpoint): - return 'https://api.twitter.com/oauth/' + endpoint - def apply_auth(self): return OAuth1(self.consumer_key, client_secret=self.consumer_secret, @@ -54,6 +51,9 @@ class OAuth1UserHandler: resource_owner_secret=self.access_token_secret, decoding=None) + def _get_oauth_url(self, endpoint): + return 'https://api.twitter.com/oauth/' + endpoint + def _get_request_token(self, access_type=None): try: url = self._get_oauth_url('request_token') @@ -63,10 +63,6 @@ class OAuth1UserHandler: except Exception as e: raise TweepyException(e) - def set_access_token(self, key, secret): - self.access_token = key - self.access_token_secret = secret - def get_authorization_url(self, signin_with_twitter=False, access_type=None): @@ -102,6 +98,10 @@ class OAuth1UserHandler: except Exception as e: raise TweepyException(e) + def set_access_token(self, key, secret): + self.access_token = key + self.access_token_secret = secret + class OAuthHandler(OAuth1UserHandler): """Alias for :class:`OAuth1UserHandler`