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

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would advise against using the backspace key, since that… May 17, 2026 at 9:02 am
  • Editorial Team
    Editorial Team added an answer (Note: I'll assume that by "decode and dispatch" you mean… May 17, 2026 at 9:02 am
  • Editorial Team
    Editorial Team added an answer Non static properties (alias fields, alias member variables) have their… May 17, 2026 at 9:01 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Python's subprocess module by default passes all open file descriptors to any child processes
Using Python 2.6, is there a way to check if all the items of
Is there a built-in method in Python to get an array of all a
Is there a way to programmatically trace the execution of all python functions/methods? I
I use cvs to maintain all my python snippets, notes, c, c++ code. As
I can't seem to get the wsgiref module to work at all under Python
At the beginning of all my executable Python scripts I put the shebang line:
WARNING: I have been learning Python for all of 10 minutes so apologies for
A python script need to spawn multiple sub-processes via fork(). All of those child
How do you apply 'or' to all values of a list in Python? I'm

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.