Vizible’s Blog

Find Pidgin Protocol ID

Posted in Programming by wearetherock on January 20, 2009

Problem : Don’t know my MSN protocal ID ,
————————————————————————–

import dbus,gobject

from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default=True)

bus = dbus.SessionBus()
object = bus.get_object("im.pidgin.purple.PurpleService",
		"/im/pidgin/purple/PurpleObject")

pidgin = dbus.Interface(object, "im.pidgin.purple.PurpleInterface")

def status_change_handler(account, status_old, status_new):
  print pidgin.PurpleAccountGetProtocolId(account)
  
bus.add_signal_receiver(status_change_handler ,
  dbus_interface='im.pidgin.purple.PurpleInterface',
  signal_name="AccountStatusChanged")
  
loop = gobject.MainLoop()
loop.run()

————————————————————————–

Output :

prpl-msn

Advertisements
Tagged with: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: