Made retweets threaded
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user