Skip to content

Commit

Permalink
Merge pull request #729 from imobachgs/unify-rust-services
Browse files Browse the repository at this point in the history
Use a single D-Bus service for Rust-based services (locale, network and questions)
  • Loading branch information
imobachgs committed Sep 1, 2023
2 parents e3bceb8 + cd6258e commit 5cf8ec0
Show file tree
Hide file tree
Showing 55 changed files with 474 additions and 373 deletions.
57 changes: 57 additions & 0 deletions doc/dbus/bus/org.opensuse.Agama.Manager1.bus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<node name="/org/opensuse/Agama/Manager1">
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml_data" direction="out" type="s"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" direction="in" type="s"/>
<arg name="property_name" direction="in" type="s"/>
<arg name="value" direction="out" type="v"/>
</method>
<method name="Set">
<arg name="interface_name" direction="in" type="s"/>
<arg name="property_name" direction="in" type="s"/>
<arg name="val" direction="in" type="v"/>
</method>
<method name="GetAll">
<arg name="interface_name" direction="in" type="s"/>
<arg name="value" direction="out" type="a{sv}"/>
</method>
<signal name="PropertiesChanged">
<arg name="interface" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Manager1">
<method name="Probe">
</method>
<method name="Commit">
</method>
<method name="CanInstall">
<arg name="result" direction="out" type="b"/>
</method>
<method name="CollectLogs">
<arg name="user" direction="in" type="s"/>
<arg name="tarball_filesystem_path" direction="out" type="s"/>
</method>
<method name="Finish">
</method>
<property type="aa{sv}" name="InstallationPhases" access="read"/>
<property type="u" name="CurrentInstallationPhase" access="read"/>
<property type="b" name="IguanaBackend" access="read"/>
<property type="as" name="BusyServices" access="read"/>
</interface>
<interface name="org.opensuse.Agama1.Progress">
<property type="u" name="TotalSteps" access="read"/>
<property type="(us)" name="CurrentStep" access="read"/>
<property type="b" name="Finished" access="read"/>
</interface>
<interface name="org.opensuse.Agama1.ServiceStatus">
<property type="aa{sv}" name="All" access="read"/>
<property type="u" name="Current" access="read"/>
</interface>
</node>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Locale1">
<interface name="org.opensuse.Agama1.Locale">
<!--
Get labels for locales. The first pair is english language and territory
and second one is localized one to target language from locale.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Questions1.Generic">
<interface name="org.opensuse.Agama1.Questions.Generic">
<property name="Answer" type="s" access="readwrite"/>
<property name="Class" type="s" access="read"/>
<property name="Data" type="a{ss}" access="read"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Questions1.Generic">
<interface name="org.opensuse.Agama1.Questions.Generic">
<property name="Answer" type="s" access="readwrite"/>
<property name="Class" type="s" access="read"/>
<property name="Data" type="a{ss}" access="read"/>
Expand All @@ -45,7 +45,7 @@
<property name="Options" type="as" access="read"/>
<property name="Text" type="s" access="read"/>
</interface>
<interface name="org.opensuse.Agama.Questions1.WithPassword">
<interface name="org.opensuse.Agama1.Questions.WithPassword">
<property name="Password" type="s" access="readwrite"/>
</interface>
</node>
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.opensuse.Agama.Questions1">
<interface name="org.opensuse.Agama1.Questions">
<!--
creates new generic question without answer
-->
Expand Down
37 changes: 18 additions & 19 deletions doc/dbus/bus/seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ cleanup() {
DD=org.opensuse.Agama
SS=/${DD//./\/}

abusctl introspect --xml-interface ${DD}1 ${SS}1/Manager \
abusctl introspect --xml-interface ${DD}1 ${SS}1/Locale \
| cleanup \
> ${DD}1.Manager.bus.xml
> ${DD}1.Locale.bus.xml

look() {
abusctl tree --list $DD.${1%.*}
Expand All @@ -31,37 +31,36 @@ look() {
> $DD.$1.bus.xml
}

look Locale1
look Questions1
look Manager1
look Software1
look Software1.Proposal
look Storage1
look Users1

abusctl introspect --xml-interface \
${DD}.Questions1 \
${SS}/Questions1 \
${DD}1 \
${SS}1/Questions \
| cleanup \
> ${DD}.Questions1.bus.xml
> ${DD}1.Questions.bus.xml

abusctl call \
${DD}.Questions1 \
${SS}/Questions1 \
${DD}.Questions1 \
${DD}1 \
${SS}1/Questions \
${DD}1.Questions \
New "ssassa{ss}" "org.bands.Clash" "should I stay or should I go" 2 yes no yes 0
abusctl introspect --xml-interface \
${DD}.Questions1 \
${SS}/Questions1/0 \
${DD}1 \
${SS}1/Questions/0 \
| cleanup \
> ${DD}.Questions1.Generic.bus.xml
> ${DD}1.Questions.Generic.bus.xml

abusctl call \
${DD}.Questions1 \
${SS}/Questions1 \
${DD}.Questions1 \
${DD}1 \
${SS}1/Questions \
${DD}1.Questions \
NewWithPassword "ssassa{ss}" "world.MiddleEarth.Moria.gate1" "Speak friend and enter" 2 enter giveup giveup 0
abusctl introspect --xml-interface \
${DD}.Questions1 \
${SS}/Questions1/1 \
${DD}1 \
${SS}1/Questions/1 \
| cleanup \
> ${DD}.Questions1.WithPassword.bus.xml
> ${DD}1.Questions.WithPassword.bus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<!--
org.opensuse.Agama.Locale1:
org.opensuse.Agama1.Locale:
Implementation note about language identifiers:
Maybe use <ulink url="https://www.rubydoc.info/github/yast/yast-packager/master/LanguageTag">yast2-packager/LanguageTag</ulink>.
See <ulink url="https://lists.opensuse.org/archives/list/yast-devel&commat;lists.opensuse.org/message/D52PSZ7TRID2RVM6CE6K2C2RUNNGOS6Z/">its announcement on yast-devel</ulink>.
See also <ulink url="https://tools.ietf.org/html/rfc4647">RFC 4647 Matching of Language Tags</ulink>.
-->
<interface name="org.opensuse.Agama.Locale1">
<interface name="org.opensuse.Agama1.Locale">
<!--
Get labels for locales. The first pair is english language and territory
and second one is localized one to target language from locale.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.opensuse.Agama.Questions1.Generic">
<interface name="org.opensuse.Agama1.Questions.Generic">
<!--
Answer:
Answer for the question. Clients set an option as answer.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.opensuse.Agama.Questions1.WithPassword">
<interface name="org.opensuse.Agama1.Questions.WithPassword">
<!--
Password:
Password provided to decrypt whatever appropriate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<!--
org.opensuse.Agama.Questions1:
org.opensuse.Agama1.Questions:
Agama offers a mechanism to communicate with clients. The D-Bus service exports a *Questions*
object that implements the *org.freedesktop.DBus.ObjectManager* interface. Individual questions are
dynamically exported in a tree under the */org/opensuse/Agama/Questions1* path, for example:
dynamically exported in a tree under the */org/opensuse/Agama1.Questions* path, for example:
~~~
/org/opensuse/Agama/Questions1
/org/opensuse/Agama/Questions1/1
/org/opensuse/Agama/Questions1/2
/org/opensuse/Agama/Questions1/4
/org/opensuse/Agama1/Questions
/org/opensuse/Agama1/Questions/1
/org/opensuse/Agama1/Questions/2
/org/opensuse/Agama1/Questions/4
~~~
Each D-Bus question implements its own set of interfaces, depending on the type of question. For
example, a generic question implements *org.opensuse.Agama.Question1*. And a question asking
for the activation of a LUKS device also implements *org.opensuse.Agama.Questions1.WithPassword*.
for the activation of a LUKS device also implements *org.opensuse.Agama1.Questions.WithPassword*.
Questions can be "unexported" from the ObjectManager tree. The service typically unexports a question
when the question is answered and the answer is successfully read.
-->
<interface name="org.opensuse.Agama.Questions1">
<interface name="org.opensuse.Agama1.Questions">
<!--
New:
@class: string identifier of the same questions. Useful to identify
Expand Down
6 changes: 3 additions & 3 deletions doc/dbus_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ We use these resources to get more familiar with D-Bus API designing.

## Language

Iface: o.o.Agama.Locale1
Iface: o.o.Agama1.Locale

See the new-style [reference][lang-ref] ([source][lang-src]).

[lang-ref]: https://opensuse.github.io/agama/dbus/ref-org.opensuse.Agama.Locale1.html
[lang-src]: dbus/org.opensuse.Agama.Locale1.doc.xml
[lang-ref]: https://opensuse.github.io/agama/dbus/ref-org.opensuse.Agama1.Locale.html
[lang-src]: dbus/org.opensuse.Agama1.Locale.doc.xml

## Base Product

Expand Down
8 changes: 4 additions & 4 deletions doc/locale_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ In the following dump, we see that the locale was set by the user and the
system has adjusted the keyboard.

```
node ...Agama/Locale1 {
interface ...Agama.Locale1 {
node ...Agama1/Locale {
interface ...Agama1.Locale {
properties:
readwrite (yas) Locale = (23, ['cs_CZ.UTF-8', 'de_DE.UTF-8']);
readwrite (y(ss)) X11Keyboard = (42, ('cz','qwerty));
Expand Down Expand Up @@ -155,8 +155,8 @@ linking them to languages and territories.

```
# this is gdbus syntax BTW
node /org/opensuse/Agama/Locale1 {
interface org.opensuse.Agama.Locale1 {
node /org/opensuse/Agama1/Locale {
interface org.opensuse.Agama1.Locale {
methods:
# In the same order as in SupportedLocales, pairs of
# (english_labels, native_labels), where foo_labels
Expand Down
2 changes: 1 addition & 1 deletion playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ See the `playwright.config.ts` file for the list of configured projects.

### Running Tests Directly from the Live ISO

You can download the `default-Playwright` image type from the [systemsmanagement:Agama:Staging](
You can download the `openSUSE-Playwright` image type from the [systemsmanagement:Agama:Staging](
https://download.opensuse.org/repositories/systemsmanagement:/Agama:/Staging/images/iso/) repository.

This ISO additionally includes the Playwright tool, Chromium browser and the
Expand Down
Loading

0 comments on commit 5cf8ec0

Please sign in to comment.