From f683391169cf7f143df380779bf69d6b9b3947b8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 9 Aug 2011 12:00:51 +0200 Subject: test: allow modem numbers in addition to object paths If the command-line arg doesn't look like an object path, treat it as the modem # and make the object path. --- test/disable.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/disable.py') diff --git a/test/disable.py b/test/disable.py index 5b8c14a3..4e52cf1d 100755 --- a/test/disable.py +++ b/test/disable.py @@ -21,7 +21,10 @@ MM_DBUS_PATH='/org/freedesktop/ModemManager' MM_DBUS_INTERFACE_MODEM='org.freedesktop.ModemManager.Modem' bus = dbus.SystemBus() -proxy = bus.get_object(MM_DBUS_SERVICE, sys.argv[1]) +objpath = sys.argv[1] +if objpath[:1] != '/': + objpath = "/org/freedesktop/ModemManager/Modems/" + str(objpath) +proxy = bus.get_object(MM_DBUS_SERVICE, objpath) modem = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM) modem.Enable (False) -- cgit v1.2.3-70-g09d2