From 8bf063fdf9626c31427ecb54fb3a8720a7666558 Mon Sep 17 00:00:00 2001 From: Ryan McGrath Date: Mon, 27 Jul 2009 03:13:15 -0400 Subject: [PATCH] Specifying OAuth urls when user specifies OAuth style login --- tango.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tango.py b/tango.py index 3e30015..f2ccb48 100644 --- a/tango.py +++ b/tango.py @@ -17,13 +17,6 @@ from urllib2 import HTTPError __author__ = "Ryan McGrath " __version__ = "0.5" -""" -REQUEST_TOKEN_URL = 'https://twitter.com/oauth/request_token' -ACCESS_TOKEN_URL = 'https://twitter.com/oauth/access_token' -AUTHORIZATION_URL = 'http://twitter.com/oauth/authorize' -SIGNIN_URL = 'http://twitter.com/oauth/authenticate' -""" - try: import simplejson except ImportError: @@ -60,7 +53,11 @@ class setup: self.oauth_keys = oauth_keys if self.username is not None and self.password is not None: if self.authtype == "OAuth": - pass + self.request_token_url = 'https://twitter.com/oauth/request_token' + self.access_token_url = 'https://twitter.com/oauth/access_token' + self.authorization_url = 'http://twitter.com/oauth/authorize' + self.signin_url = 'http://twitter.com/oauth/authenticate' + # Do OAuth type stuff here - how should this be handled? Seems like a framework question... elif self.authtype == "Basic": self.auth_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() self.auth_manager.add_password(None, "http://twitter.com", self.username, self.password)