문제

In my application I want to send notifications to users through their pidgin internet messanger using python 2.4.

Does anyone can show some light on how this can be done?

도움이 되었습니까?

해결책

Here is an example code using dbus (with Python 2.7, cannot test it with 2.4), but the problem is that it opens a conversation window. I haven't find a way to hide/close/minimize the window.

import dbus
session_bus = dbus.SessionBus()
purple_obj = session_bus.get_object("im.pidgin.purple.PurpleService",
                                    "/im/pidgin/purple/PurpleObject")
purple_int = dbus.Interface(purple_obj, 
                            "im.pidgin.purple.PurpleInterface")
my_account_id = purple_int.PurpleAccountsGetAllActive()[0] # or some other account from yours
conv = purple_int.PurpleConversationNew(1, my_account_id, "recipient's email")
conv_im = purple_int.PurpleConvIm(conv)
purple_int.PurpleConvImSend(conv_im, "This is your message")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top