All pastes #903034 Raw Edit

Stuff

public python v1 · immutable
·published 2008-02-13 23:00 UTC
rendered paste body
#!/usr/bin/env pythonimport dbus, gobjectdef recIM(account, sender, message, conversation, flags):	print sender, "said:", messagedef receiveAuth(account, user):	print account, "received authorization request from", user	return -1	from dbus.mainloop.glib import DBusGMainLoopdbus.mainloop.glib.DBusGMainLoop(set_as_default=True)bus = dbus.SessionBus()bus.add_signal_receiver(receiveAuth,                        dbus_interface="im.pidgin.purple.PurpleInterface",                        signal_name="AccountAuthorizationRequested")bus.add_signal_receiver(recIM,                        dbus_interface="im.pidgin.purple.PurpleInterface",                        signal_name="ReceivedImMsg")loop = gobject.MainLoop()loop.run()