Yeah.Till now things seem to be fine:-)<br>
I will let you know if some problem occurs.<br><br><div class="gmail_quote">On Sat, Sep 12, 2009 at 8:48 PM, Kaustubh Atrawalkar <span dir="ltr"><<a href="mailto:kaustubh.ra@gmail.com">kaustubh.ra@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You are welcome cbx. I was about to write a program for you :)<br>Anyway, let me know if u stuck somewhere still.<br>
<br>--<br>Regards<br><font color="#888888">Kaustubh</font><div><div></div><div class="h5"><br>
<br><br><div class="gmail_quote">On Sat, Sep 12, 2009 at 6:15 PM, cbx <span dir="ltr"><<a href="mailto:bnucbx@gmail.com" target="_blank">bnucbx@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I got it!<br>I use the wrong object path, so i can't get the signal<br>the correct one is /org/freedesktop/DBus,as follows<br>proxy = sessionBus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')<br>
<br>Thank you!<br><br><br><br>_______________________________<br>quoted text:<div><br><br>Thanks.Maybe i don't totally get what you mean.<br>i tried the following code.When rhythmbox lauches or quits,nothing is printed.<br>
Code in python:<br><br>import dbus<br>from dbus.mainloop.glib import DBusGMainLoop<br>
import gobject<br>import glib<br><br>class Test:<br> def __init__(self):<br> DBusGMainLoop(set_as_default=</div><div>True)<br> sessionBus = dbus.SessionBus()<br><br> proxy = sessionBus.get_object('org.freedesktop.DBus', '/')#this object path is wrong<div>
<br>
self.interface = dbus.Interface(proxy, 'org.freedesktop.DBus')<br> self.interface.connect_to_signal('NameOwnerChanged', self.callback)<br><br> gobject.MainLoop().run()<br>
<br> def callback(self, s1, s2, s3):<br> print s1, s2, s3<br><br>if __name__ == '__main__':<br> Test()</div></div><br>
</blockquote></div><br>
</div></div></blockquote></div><br>