Advertisement
Guest User

pidgin.py

a guest
Sep 24th, 2012
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.44 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. #  pidgin.py
  5. #  
  6. #  Copyright 2012 รngel Araya <angel@angel-TECRA-A8>
  7. #  
  8. #  This program is free software; you can redistribute it and/or modify
  9. #  it under the terms of the GNU General Public License as published by
  10. #  the Free Software Foundation; either version 2 of the License, or
  11. #  (at your option) any later version.
  12. #  
  13. #  This program is distributed in the hope that it will be useful,
  14. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. #  GNU General Public License for more details.
  17. #  
  18. #  You should have received a copy of the GNU General Public License
  19. #  along with this program; if not, write to the Free Software
  20. #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  21. #  MA 02110-1301, USA.
  22. #  
  23. #  
  24.  
  25. def listener(conv, type):
  26.     print (type) #Debug line
  27.     if type == 4: # Corresponds to UNSEEN_STATE_CHANGED and others I can't distinguish now
  28.         print ("Status changed, possibly read messages")
  29.        
  30.    
  31. import dbus, gobject
  32. import dbus, gobject
  33. from dbus.mainloop.glib import DBusGMainLoop
  34. dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
  35. bus = dbus.SessionBus()
  36.  
  37.  
  38. bus.add_signal_receiver(listener,
  39.                         dbus_interface="im.pidgin.purple.PurpleInterface",
  40.                         signal_name="ConversationUpdated")
  41.  
  42. loop = gobject.MainLoop()
  43. loop.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement