Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Expression Language #2

Open
JamesOlvertone opened this issue Jul 24, 2023 · 1 comment
Open

Spring Expression Language #2

JamesOlvertone opened this issue Jul 24, 2023 · 1 comment

Comments

@JamesOlvertone
Copy link

How can I express this ( a{sv} as parameter to a Method) with the spring expression language that is used in the FX-GUI?

Example: UDisks2
Bus: systembus,
Busname: org.freedesktop.UDisks2
Objectpath: /org/freedesktop/UDisks2/drives/choose any drive
Interface: org.freedesktop.UDisks2.Drive.Ata
Methodname: SmartGetAttributes( Dict of {String, Variant} options) -> returns Array of foo...

In d-feet (the python programm) you enter something like this, nowakeuo is a standardoption
that can be set on most Methods:
{'nowakeup': GLib.Variant("b",1)}

or an empty Set here for SmartGetAttributes() works too:
{}

In both cases you get a return value.

How do you express this with the spring expression language?

@brett-smith
Copy link
Contributor

It turns out you couldn't express this, plus there was a bug that meant even if you could, it wouldn't have worked.

I've just released version 1.1.0, which now has support for constructing a new Variant. So you can do ...

{nowakekup: new variant(true, 'b')}

"variant" is case insensitive, and it accepts either one or two arguments. The single argument new variant('some value') will automatically determine the signature, the two argument constructor lets you specify the exact signature as the 2nd argument. Note, this is the other way around to python.

Your example now results in this ..

image

Ps, thanks for bug report, and sorry for slow response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants