Made retweets threaded

This commit is contained in:
Anna
2010-05-19 00:04:01 -04:00
parent 08dd6957ff
commit c2aae17e5b
2 changed files with 40 additions and 5 deletions

View File

@ -283,6 +283,27 @@ class PostUpdate(ApiThread):
class PostRetweet(ApiThread):
def __init__(self, api, retweet_id):
ApiThread.__init__(self, api)
self.sig_proxy = SigProxy()
self.retweet_id = retweet_id
def run(self):
try:
with self.api.lock:
self.api.PostRetweet(self.retweet_id)
success = True
except (HTTPError, URLError):
success = False
self.sig_proxy.emit('retweet-posted', success)
### End class PostRetweet
class SigProxy(gtk.Alignment):
"""
This little class exists just so that we can have a gtk class in our
@ -303,6 +324,10 @@ gobject.signal_new("update-posted", SigProxy,
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
gobject.signal_new("retweet-posted", SigProxy,
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
# We use these classes to emulate a Status object when we need
# one to be built out of something else.