tools: ratbagctl: only warn that no devices are available in list_devices

If the other commands try to access a node, there will be an other error
("Unable to find device X"). So there is no points in having this as a
global check.

For the .devel and .test versions, we are guaranteed to have the
test_device at least, so no worries on this side too.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2017-09-14 10:36:32 +02:00
parent 5efd83fc41
commit 1c94ef5c56

View File

@@ -55,6 +55,9 @@ for k, v in [(v, k) for k, v in button_specials_strmap.items()]:
def list_devices(r, args):
if not r.devices:
print("No devices available.")
for d in r.devices:
print("{:10s} {:32s}".format(d.id + ":", d.name))
@@ -1445,9 +1448,6 @@ def open_ratbagd(ratbagd_process=None):
print("Unable to connect to ratbagd over dbus")
return None
if not r.devices:
print("No devices available.")
if ratbagd_process is not None:
# if some old version of ratbagd is still running, ratbagd_process may
# have never started but our DBus bindings may succeed. Check for the