~clint-fewbar/ubuntu/precise/modemmanager/fix-removed-not-purged

« back to all changes in this revision

Viewing changes to test/enable.py

  • Committer: Package Import Robot
  • Author(s): Artem Popov
  • Date: 2012-01-02 13:32:18 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120102133218-f2xuil48af71xa7b
Tags: upstream-0.5+git.20111231t174444.1e332ab
ImportĀ upstreamĀ versionĀ 0.5+git.20111231t174444.1e332ab

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
MM_DBUS_INTERFACE_MODEM='org.freedesktop.ModemManager.Modem'
22
22
 
23
23
bus = dbus.SystemBus()
24
 
proxy = bus.get_object(MM_DBUS_SERVICE, sys.argv[1])
 
24
objpath = sys.argv[1]
 
25
if objpath[:1] != '/':
 
26
    objpath = "/org/freedesktop/ModemManager/Modems/" + str(objpath)
 
27
proxy = bus.get_object(MM_DBUS_SERVICE, objpath)
25
28
modem = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM)
26
29
modem.Enable (True)
27
30