Skip to main content

Python decorator for dbus interface client definition

Project description

Python decorators to define dbus interface, then use it as lib.

For examples see mpris2 ( https://github.com/hugosenari/mpris2 )

See also:

dbus2any: convert dbus instrospection into code ( https://github.com/hugosenari/dbus2any )

Require:

Python dbus

Example:

Import decorators

>>> from dbusdecorator import DbusAttr, DbusInterface, DbusMethod

Define dbus interface

>>> @DbusInterface('org.mpris.MediaPlayer2', '/org/mpris/MediaPlayer2')
>>> class Player(object):
>>>    @DbusMethod
>>>    def Next(self):
>>>       pass
>>>    @DbusAttr
>>>    def Volume(self):
>>>       pass

Use your definition

>>> mediaplayer2 = Player(
>>>    dbus_interface_info={
>>>       'dbus_uri': 'org.mpris.MediaPlayer2.gmusicbrowser'})
>>> mediaplayer2.Next()
>>> print mediaplayer2.Volume
>>> mediaplayer2.Volume = 1
>>> print mediaplayer2.Volume # integer = 1 :P

See also:

dbus2any is a subproject now I created a project only for this (https://github.com/hugosenari/dbus2any)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydbusdecorator-2.0.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file pydbusdecorator-2.0.tar.gz.

File metadata

  • Download URL: pydbusdecorator-2.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydbusdecorator-2.0.tar.gz
Algorithm Hash digest
SHA256 e4fc37062af435f0eb99ae3342eb1493fe1cbee303103937cdcf5895a70dba7d
MD5 2e2a3175f050885d2971f2f88ae85fcd
BLAKE2b-256 94423217300bdb07a23ff8d69072b659b6464ede4b70e472f5f237fa8551161a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page