aboutsummaryrefslogtreecommitdiff
path: root/test/ussd.py
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2011-08-09 12:00:51 +0200
committerDan Williams <dcbw@redhat.com>2011-08-09 16:49:29 +0200
commitf683391169cf7f143df380779bf69d6b9b3947b8 (patch)
tree29e5b3201b08f27039f073d6ab45bc0671dfecea /test/ussd.py
parent33a97cdb139059a8f4e2a1fefe9f2c237171caf1 (diff)
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.
Diffstat (limited to 'test/ussd.py')
-rwxr-xr-xtest/ussd.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ussd.py b/test/ussd.py
index b3528f9d..73b8f8ec 100755
--- a/test/ussd.py
+++ b/test/ussd.py
@@ -27,7 +27,11 @@ else:
arg = sys.argv[2]
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_USSD)
# For testing purposes treat all "common" USSD sequences as initiate and the