Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1090267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:20:59+00:00 2026-05-16T23:20:59+00:00

In all python dbus documentations there are info on how to export objects, interfaces,

  • 0

In all python dbus documentations there are info on how to export objects, interfaces, signals, but there is nothing how to export interface property.

Any ideas how to do that ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:21:00+00:00Added an answer on May 16, 2026 at 11:21 pm

    It’s definitely possible to implement D-Bus properties in Python! D-Bus properties are just methods on a particular interface, namely org.freedesktop.DBus.Properties. The interface is defined in the D-Bus specification; you can implement it on your class just like you implement any other D-Bus interface:

    # Untested, just off the top of my head
    
    import dbus
    
    MY_INTERFACE = 'com.example.Foo'
    
    class Foo(dbus.service.object):
        # …
    
        @dbus.service.method(interface=dbus.PROPERTIES_IFACE,
                             in_signature='ss', out_signature='v')
        def Get(self, interface_name, property_name):
            return self.GetAll(interface_name)[property_name]
    
        @dbus.service.method(interface=dbus.PROPERTIES_IFACE,
                             in_signature='s', out_signature='a{sv}')
        def GetAll(self, interface_name):
            if interface_name == MY_INTERFACE:
                return { 'Blah': self.blah,
                         # …
                       }
            else:
                raise dbus.exceptions.DBusException(
                    'com.example.UnknownInterface',
                    'The Foo object does not implement the %s interface'
                        % interface_name)
    
        @dbus.service.method(interface=dbus.PROPERTIES_IFACE,
                             in_signature='ssv'):
        def Set(self, interface_name, property_name, new_value):
            # validate the property name and value, update internal state…
            self.PropertiesChanged(interface_name,
                { property_name: new_value }, [])
    
        @dbus.service.signal(interface=dbus.PROPERTIES_IFACE,
                             signature='sa{sv}as')
        def PropertiesChanged(self, interface_name, changed_properties,
                              invalidated_properties):
            pass
    

    dbus-python ought to make it easier to implement properties, but it currently is very lightly maintained at best.

    If someone fancied diving in and helping fix up stuff like this, they’d be most welcome. Even adding an expanded version of this boilerplate to the documentation would be a start, as this is quite a frequently asked question. If you’re interested, patches could be sent to the D-Bus mailing list, or attached to bugs filed against dbus-python on the FreeDesktop bugtracker.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

are there any 3rd party libs at all in python that do something on
Does Python have a pool of all strings and are they (strings) singletons there?
Is there a way to programmatically trace the execution of all python functions/methods? I
Is there an easy way to get a report of all Python libraries installed
Is there a way of listing all python modules directly underneath a specified model
Can I eliminate all Python loops in this computation: result[i,j,k] = (x[i] * y[j]
How do I get a list of all python modules available? I don't want
I have looked on the web to find a list of all Python keywords
All the Python built-ins are subclasses of object and I come across many user-defined
I don't program in Python at all, so please forgive my code. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.