david4dev
david4dev

Reputation: 4914

How to expose a dbus method with multiple arguments?

Is it possible to create a dbus method that accepts multiple arguments?

I wish to make a method like this:

def some_method(self, string, list_of_strings):
    #do something with arguments

into a method accessible using dbus. Is there a way to specify multiple arguments in dbus. My only solution so far is to use one big list as my arguments:

@dbus.service.method('org.my.service', in_signature='as')
def some_method(self, list_of_strings):
    string = list_of_strings.pop(0)

I would prefer to have the arguments separate - how, if at all, can this be done?

Upvotes: 1

Views: 1362

Answers (1)

adw
adw

Reputation: 5021

I believe in_signature='sas' would achieve what you want.

Upvotes: 2

Related Questions