I should have been more clear. Forgive the large text dump here, but I'm not certain how to better explain what I'm seeing. Below is the output of dbus-monitor, the first clip from a successful run, the second from a failed run. In one terminal I launch dbus-monitor and in another I execute 'python
tbird.py'.<br><br>You'll notice (where I've marked with '*****') that in the failed run, the NewMail signal comes before GetNameOwner (which I meant in my first post as the point were things are fully registered), but that in the successful run, GetNameOwner comes before the call to NewMail.
<br><br>For full disclosure, I have another script that listens for NameOwnerChanged and when it finds the org.mozilla.thunderbird.DBus change, connects a callback function to the NewMail signal - so by successful run, I mean the callback function gets fired. It's certainly possible that my problem is on that side, but it does seem strange that I'm seeing the NewMail signal before the GetNameOwner method call in the bad run.
<br><br>I noticed that when running the command you used, I see no GetNameOwner call - is this a sign that the problem is on the other end (is GetNameOwner a result of connecting the callback function)?<br><br>Thanks for your help,
<br>Jim<br><br>dbus-monitor output below:<br><br>--------------------------------------------------------<br>Successful Run:<br>--------------------------------------------------------<br>
signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
<br> string ":1.40"
<br> string ""
<br> string ":1.40"<br> <br>method call sender=:1.40 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
<br><br>signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
<br> string "org.mozilla.thunderbird.DBus"
<br> string ""
<br> string ":1.40"
<br><br>method call sender=:1.40 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
<br> string "org.mozilla.thunderbird.DBus"
<br> uint32 0
<br><br>method call sender=:1.33 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus.Introspectable; member=Introspect
<br><br>*******<br>method call sender=:1.33 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
<br> string "org.mozilla.thunderbird.DBus"
<br><br>method call sender=:1.33 -> dest=:1.40 path=/org/mozilla/thunderbird/DBus/NewMail; interface=org.freedesktop.DBus.Introspectable; member=Introspect
<br><br>method call sender=:1.33 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
<br> string "type='signal',sender=':1.40',path='/org/mozilla/thunderbird/DBus/NewMail',interface='org.mozilla.thunderbird.DBus',member='NewMail'"
<br><br>signal sender=:1.40 -> dest=(null destination) path=/org/mozilla/thunderbird/DBus/NewMail; interface=org.mozilla.thunderbird.DBus; member=NewMail
<br> string "test"
<br> string "test"
<br><br>signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
<br> string "org.mozilla.thunderbird.DBus"
<br> string ":1.40"
<br> string ""
<br><br>signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
<br> string ":1.40"
<br> string ":1.40"
<br> string ""<br><br>--------------------------------------------------------<br>
Bad Run:<br>
--------------------------------------------------------<br>signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
<br> string ":1.35"
<br> string ""
<br> string ":1.35"<br> <br>method call sender=:1.35 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello<br> <br>signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=
org.freedesktop.DBus; member=NameOwnerChanged
<br> string "org.mozilla.thunderbird.DBus"
<br> string ""
<br> string ":1.35"<br> <br>method call sender=:1.35 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
<br> string "org.mozilla.thunderbird.DBus"
<br> uint32 0<br> <br>method call sender=:1.33 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus.Introspectable; member=Introspect
<br><br>*******<br>signal sender=:1.35 -> dest=(null destination) path=/org/mozilla/thunderbird/DBus/NewMail; interface=org.mozilla.thunderbird.DBus; member=NewMail
<br> string "test"
<br> string "test"
<br><br>method call sender=:1.33 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
<br> string "org.mozilla.thunderbird.DBus"
<br><br>method call sender=:1.33 -> dest=:1.35 path=/org/mozilla/thunderbird/DBus/NewMail; interface=org.freedesktop.DBus.Introspectable; member=Introspect
<br><br>method call sender=:1.33 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
<br> string "type='signal',sender=':1.35',path='/org/mozilla/thunderbird/DBus/<br>NewMail',interface='org.mozilla.thunderbird.DBus',member='NewMail'"
<br><br>signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
<br> string "org.mozilla.thunderbird.DBus"
<br> string ":1.35"
<br> string ""
<br><br>signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
<br> string ":1.35"
<br> string ":1.35"
<br> string "" <br><br><br><div><span class="gmail_quote">On 8/1/07, <b class="gmail_sendername">Simon McVittie</b> <<a href="mailto:simon.mcvittie@collabora.co.uk">simon.mcvittie@collabora.co.uk</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Wed, 01 Aug 2007 at 09:41:09 -0400, Jim Kytola wrote:<br>> Using the below code (without the sleep call) I would almost always see the
<br>> call to my emitter function before the object was fully registered on the<br>> dbus. If I add the sleep call, it works, however, the sleep (like I would<br>> expect) causes Thunderbird to hang for that time. Am I missing something
<br>> here - does anyone have any suggestions for a better way to do what I'm<br>> trying to do?<br><br>What do you mean by "fully registered"?<br><br>Test case: if I remove the time.sleep() call from your code and run:
<br><br> dbus-launch sh -c 'dbus-monitor & sleep 1; python tbird.py; sleep 1'<br><br>I see events in this order:<br><br>signal NameOwnerChanged, name=:1.1, old="", new=:1.1 (tbird.py joins bus)<br>
signal NameOwnerChanged, name=org.mozilla.thunderbird.DBus, old="", new=:1.1<br> (tbird.py is given its desired bus name)<br>signal NewMail (tbird.py emits its signal)<br>signal NameOwnerChanged, name=org.mozilla.thunderbird.DBus
, old=:1.1, new=""<br> (tbird.py releases its bus name during shutdown)<br>signal NameOwnerChanged, name=:1.1, old=:1.1, new="" (tbird.py leaves bus)<br><br>This looks to me like the desired behaviour. What's the problem?
<br><br> Simon<br>_______________________________________________<br>dbus mailing list<br><a href="mailto:dbus@lists.freedesktop.org">dbus@lists.freedesktop.org</a><br><a href="http://lists.freedesktop.org/mailman/listinfo/dbus">
http://lists.freedesktop.org/mailman/listinfo/dbus</a><br></blockquote></div><br>