Guest User

Untitled

a guest
May 26th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class PostCommand(BaseCommand):
  2.  
  3. def __init__(self):
  4. super(PostCommand, self).__init__('post', 'Post to FriendFeed.')
  5.  
  6. def __call__(self, user, prot, args, session):
  7. ffsession = friendfeed.FriendFeed(user.nickname, user.remotekey)
  8. d = threads.deferToThread(ffsession.publish_message,str(args))
  9. d.addCallback(self._postCallback)
  10.  
  11. def _postCallback(self,result):
  12. prot.send_plain(user.jid, "Post Result: %s" % str(result))
Add Comment
Please, Sign In to add comment