Ann: txDBus 1.0 - Native Python implementation of DBus for Twisted

Tom Cocagne tom.cocagne at gmail.com
Fri Jul 6 05:34:30 PDT 2012


Thanks Pavel. I haven't done any testing yet on Windows so it'll
almost certainly break in a few places but they'll probably be easy
things to fix. If you give it a shot and get hung up before I get
around to ironing out the bugs (likely) just shoot me an e-mail.

With respect to the comparison to dbus-python, I took a different
approach with txdbus that eliminates the need for signal decorators
entirely and requires methods decorators only when multiple interfaces
define a function of the same name. I believe txdbus has the same
level of functionality in this regard but the way you go about using
it is definitely different. BusName management is also a little
different in that it requires explicit acquire/release functions. I
hadn't noticed dbus-python's approach of tying the name to the
lifetime of a Python object. That's not a bad idea and might be
something I'll add in as an option at some point.

If you notice any functional omissions, please let me know. So far,
it's been just me working on it so there's bound to be plenty of
oversights.

Tom

On Fri, Jul 6, 2012 at 3:16 AM, Pavel Strashkin
<pavel.strashkin at gmail.com> wrote:
> Hi Tom,
>
> That is just amazing! For those who are not interested in speed that
> is a good opportunity to start using dbus + python on Windows while
> dbus-python is being ported.
>
> The only thing i miss in txDBus comparing to dbus-python is the way to
> export services/objects.
> In dbus-python there are dbus.service.BusName (Service) and
> dbus.service.Object with dbus_method and dbus_signal decorators.
>
> class MyObject(dbus.service.Object):
>   @dbus.service.method(interface, in_args, out_args, ...)
>   def sum(self, a, b):
>     return self.sumCalculated(a + b) # emits signal
>
>    @dbus.service.signal(interface, signature)
>    def sumCalculated(self, sum):
>      return sum
>
> Anyway good start. Keep improving it!
>
> 2012/7/5 Tom Cocagne <tom.cocagne at gmail.com>:
>> For those interested, I've recently released a pure-python
>> implementation of DBus that's specifically geared for the Twisted
>> networking library. It's significantly slower than the libdbus binding
>> (approximately 1/3rd to 1/5th the performance) on the CPython
>> interpreter but runs at about the same speed as the libdbus bindings
>> when running on the pypy.
>>
>> The documentation includes a comprehensive tutorial on how to use the
>> library as well as a general-purpose overview of the DBus protocol.
>>
>> https://github.com/cocagne/txdbus
>>
>> http://pypi.python.org/pypi/txdbus
>>
>> Cheers,
>>
>> Tom Cocagne
>> _______________________________________________
>> dbus mailing list
>> dbus at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dbus


More information about the dbus mailing list