[python] How can a noob get a simple implementation?
Sean Meiners
sean.meiners at linspireinc.com
Tue Aug 30 21:56:09 PDT 2005
Based on my experience with the python bindings (which is quite a bit
lately) you should be able to achieve 'A' without much fuss. As for
how to do it, I just happened to be poking around the python examples
included in the DBus source tree today (python/examples) and found
example-signal-emitter.py and example-signal-recipient.py to be quite
excellent in this regard (thanks again John P). To try them out make
sure you have a session bus running and start the emitter first (the
receiver relies on it).
On Aug 30, 2005, at 8:37 AM, Federico Pelloni wrote:
> Hi everybody :-)
>
> First of all, a bit of scenery:
>
> - python window manager (today, a wrapper over Pywm)
> - python taskbar (building it on my own)
>
> They should communicate between them, and since I want this simple
> DE to be modern (the taskbar uses cairo for rendering) I thought
> the best way is DBus.
>
> My idea:
>
> 1 - a window is created
> 2 - the WM should emit a signal (let's say "window.created") over dbus
> with no particular destination (it could be useful also for a
> pager, one day)
> 3 - the taskbar receives the signal "window.created" sent by
> "org.fredp.wm"
> 4 - it draws the new task using the infos shipping with the signal
> window.created
>
> My questions:
>
> Either
> A - is it possible to have this done with a few (I mean 2 or 3, not
> many more)
> function calls? Maybe a
> dbus.emit_signal("window.created", (windowobject))
> in the WM code and a
> dbus.add_signal_receiver("window.created", self.draw_task)
> in the taskbar code. Quick and simple, I don't need much more.
> OR
> B - is there an up-to-date clear tutorial showing how to do
> something similar?
> Often I find code that doesn't work (even that from the official
> how-to,
> I can't import dbus.service)
>
>
> In the end, I'm sorry if my English is poor, it isn't my mother lang.
>
> Good bye and many thanks, Federico
>
> _______________________________________________
> dbus mailing list
> dbus at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dbus
>
--
Sean Meiners
Sean.Meiners at LinspireInc.com
Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;
More information about the dbus
mailing list