Improve order of OAuth1UserHandler methods
authorHarmon <Harmon758@gmail.com>
Fri, 7 Jan 2022 14:14:36 +0000 (08:14 -0600)
committerHarmon <Harmon758@gmail.com>
Sat, 8 Jan 2022 00:19:27 +0000 (18:19 -0600)
tweepy/auth.py

index 120e28fc5d104f640381144ebd0405c0ecc0cf5a..970c32c9d2b20fc3551a6874e9f6b4148f72d2d6 100644 (file)
@@ -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`