From: Josh Roesslein Date: Mon, 13 Jul 2009 21:33:30 +0000 (-0500) Subject: Added method to set credentials. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2d152504b8cd3b9f9f7cc73c41a44ae60d235c23;p=tweepy.git Added method to set credentials. --- diff --git a/api.py b/api.py index 120c295..526f32b 100644 --- a/api.py +++ b/api.py @@ -12,7 +12,7 @@ class API(object): classes={'user': User, 'status': Status, 'direct_message': DirectMessage, 'friendship': Friendship}): if username and password: - self._b64up = base64.b64encode('%s:%s' % (username, password)) + self.set_credentials(username, password) else: self._b64up = None self.host = host @@ -20,6 +20,10 @@ class API(object): self.classes = classes self.username = username + def set_credentials(username, password): + self._b64up = base64.b64encode('%s:%s' % (username, password)) + self.username = username + """Get public timeline""" public_timeline = bind_api( path = '/statuses/public_timeline.json',