11

I use D-Feet D-Bus debugger to investigate some interfaces. One of them requires a variant type to be send as an argument (which means that you can send anything).

But I have trouble sending the argument as variant - normal python syntax would be __import__('dbus').Boolean(0) for a boolean, but that won't work (Error.InvalidArguement).

Using variant:boolean:0 doesn't work either.

How to send a arguement as variant via D-Feet?

powerbar
  • 323
  • 3
  • 14

2 Answers2

23

In d-feet 0.3.9 at least, GLib.Variant('b', False) works.

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • I'd like ti give you +200 for that. Using d-feet 0.3.3 and it works well. – exilit Jul 11 '14 at 12:36
  • @ptomato If it is something like `GetTask (variant tid) ----> ()`, how does it work in that case? – Khurshid Alam Jul 08 '16 at 15:33
  • I don't know what `GetTask` is; maybe you should open a new question? – ptomato Jul 09 '16 at 20:24
  • Ugh, thank you for that! I tried every conceivable permutation of the text representation(s) used by dconf, since the argument format seemed to generally follow them, but I was banging against a wall trying to send a variant. (Of, as in your example, a single boolean value. Sigh. What ever happened to 1 and 0? *mumbledrone*) We should really pass the hat or something and get d-feet a real Help file, because what's there now is... sad. Just so very, very sad. – FeRD Jul 05 '17 at 07:03
3

I tried __import__('dbus').Boolean(0, variant_level=1) and it seems that it worked.

mwik
  • 193
  • 1
  • 6