[Twisted-Python] ANN: Twisted DBus 1.0 => WebSocket/WAMP Bridge

Tobias Oberstein tobias.oberstein at tavendo.de
Wed Jul 4 07:50:24 EDT 2012


Hi Tom,

Great!

I have created a quick example that bridges WebSocket/WAMP and Dbus

https://github.com/tavendo/AutobahnPython/tree/master/examples/wamp/dbus

This allows to trigger desktop notifications on one or multiple machines
from a browser based UI running anywhere via a WebSocket/WAMP PubSub
message broker in between.

Cheers,
Tobias


Mit freundlichen Grüssen,

Tobias Oberstein
Geschäftsführer

+49(0)9131 940 3574
+49(0)176 23 752 055
tobias.oberstein at tavendo.de
skype: tobias.oberstein




Tavendo GmbH · Am Weihersbach 13 · 91074 Herzogenaurach · Deutschland
Office / Postanschrift : Waldstrasse 18 · 91054 Erlangen · Deutschland
+49(+)700 GO TAVENDO · +49(0)700 46 828 36 36 · www.tavendo.de
Amtsgericht Fürth · HRB 10365 · USt-Id.Nr DE246462916 · Geschäftsführer Tobias Oberstein


> -----Ursprüngliche Nachricht-----
> Von: twisted-python-bounces at twistedmatrix.com [mailto:twisted-python-
> bounces at twistedmatrix.com] Im Auftrag von Tom Cocagne
> Gesendet: Dienstag, 3. Juli 2012 22:37
> An: Twisted general discussion
> Betreff: Re: [Twisted-Python] ANN: Twisted DBus 1.0
> 
> Nevermind. Simply removing the explicit credential passing from the client side
> of the implementation fixed the problem. txdbus 1.0.2 appears to run just fine
> on 12.1.
> 
> Tom
> 
> On Tue, Jul 3, 2012 at 10:14 AM, Tom Cocagne <tom.cocagne at gmail.com>
> wrote:
> > Unfortunately, it looks like 12.1 may be completely incompatible with
> > txdbus. The ancillary data support for Unix sockets appears to support
> > only file descriptor passing and breaks when credential passing is
> > attempted. The current implementation assumes and fails to check for
> > ancillary data sizes other than 4 (credentials are of length 12). I
> > believe it will be a relatively straight-forward task to add
> > credential passing support similar to how file descriptor passing is
> > done but it'll probably have to wait until the next Twisted release. A
> > straight-forward work-around eludes me.
> >
> > Tom
> >
> >
> > On Tue, Jul 3, 2012 at 8:16 AM, Tom Cocagne <tom.cocagne at gmail.com>
> wrote:
> >> I believe credential passing over Unix sockets is a new feature in
> >> Twisted 12.1. The older versions I used to develop this project
> >> didn't support that feature so I had to implement it myself. From the
> >> stacktrace, I'm guessing that my workaround for this is clashing with
> >> Twisted's new build-in support. I'll try and take a look at this in
> >> the near future.
> >>
> >> Tom
> >>
> >> On Tue, Jul 3, 2012 at 5:27 AM, Tobias Oberstein
> >> <tobias.oberstein at tavendo.de> wrote:
> >>>> For anyone interested in taking a look, I've just released a
> >>>> native-Python implementation of the DBus protocol for Twisted. The
> >>>> intent of the implementation is to provide Twisted applications
> >>>> with a full-featured DBus API that is consistent with the rest of
> >>>> the framework and does not require the use of the glib reactor or libdbus
> Python bindings.
> >>>
> >>> Cool! Also great work on the examples, tutorial and protocol overview!
> >>>
> >>> I'm having problems with the desktop notification example though .. any
> hints?
> >>>
> >>>
> >>> oberstet at ubuntu10bld_klon0:~/scm/twisted_dbus/doc/tutorial_examples$
> >>> ~/python273/bin/python -V Python 2.7.3
> >>> oberstet at ubuntu10bld_klon0:~/scm/twisted_dbus/doc/tutorial_examples$
> >>> uname -a Linux ubuntu10bld_klon0 2.6.32-41-generic #91-Ubuntu SMP
> >>> Wed Jun 13 11:44:43 UTC 2012 i686 GNU/Linux
> >>> oberstet at ubuntu10bld_klon0:~/scm/twisted_dbus/doc/tutorial_examples$
> >>> ~/python273/bin/python desktop_noficiation Unhandled Error Traceback
> (most recent call last):
> >>>   File "/home/oberstet/python273/lib/python2.7/site-
> packages/twisted/python/log.py", line 84, in callWithLogger
> >>>     return callWithContext({"system": lp}, func, *args, **kw)
> >>>   File "/home/oberstet/python273/lib/python2.7/site-
> packages/twisted/python/log.py", line 69, in callWithContext
> >>>     return context.call({ILogContext: newCtx}, func, *args, **kw)
> >>>   File "/home/oberstet/python273/lib/python2.7/site-
> packages/twisted/python/context.py", line 118, in callWithContext
> >>>     return self.currentContext().callWithContext(ctx, func, *args, **kw)
> >>>   File "/home/oberstet/python273/lib/python2.7/site-
> packages/twisted/python/context.py", line 81, in callWithContext
> >>>     return func(*args,**kw)
> >>> --- <exception caught here> ---
> >>>   File "/home/oberstet/python273/lib/python2.7/site-
> packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
> >>>     why = selectable.doRead()
> >>>   File "/home/oberstet/python273/lib/python2.7/site-
> packages/twisted/internet/unix.py", line 169, in doRead
> >>>     fd = struct.unpack('i', ancillary[0][2])[0]
> >>> struct.error: unpack requires a string argument of length 4
> >>>
> >>> This is on Twisted 12.1
> >>>
> >>> _______________________________________________
> >>> Twisted-Python mailing list
> >>> Twisted-Python at twistedmatrix.com
> >>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python



More information about the Twisted-Python mailing list