From 0391f0a9bfd968ce4536efa13890ff3405f9f884 Mon Sep 17 00:00:00 2001 From: "Gustavo F. Padovan" Date: Tue, 26 Jan 2010 18:58:15 -0200 Subject: [PATCH] Enable passing of modem name via command line --- test/disable-modem | 14 ++++++++------ test/enable-modem | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/test/disable-modem b/test/disable-modem index dee34fd..47b8531 100755 --- a/test/disable-modem +++ b/test/disable-modem @@ -1,15 +1,17 @@ #!/usr/bin/python import dbus +import sys bus = dbus.SystemBus() -manager = dbus.Interface(bus.get_object('org.ofono', '/'), - 'org.ofono.Manager') - -properties = manager.GetProperties() - -path = properties["Modems"][0] +if len(sys.argv) == 2: + path = sys.argv[1] +else: + manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + properties = manager.GetProperties() + path = properties["Modems"][0] modem = dbus.Interface(bus.get_object('org.ofono', path), 'org.ofono.Modem') diff --git a/test/enable-modem b/test/enable-modem index 0f9f604..86362af 100755 --- a/test/enable-modem +++ b/test/enable-modem @@ -1,15 +1,17 @@ #!/usr/bin/python import dbus +import sys bus = dbus.SystemBus() -manager = dbus.Interface(bus.get_object('org.ofono', '/'), - 'org.ofono.Manager') - -properties = manager.GetProperties() - -path = properties["Modems"][0] +if len(sys.argv) == 2: + path = sys.argv[1] +else: + manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + properties = manager.GetProperties() + path = properties["Modems"][0] modem = dbus.Interface(bus.get_object('org.ofono', path), 'org.ofono.Modem') -- 2.7.4