Home | History | Annotate | Download | only in test-scripts
      1 #!/usr/bin/python
      2 
      3 import dbus, flimflam, sys
      4 
      5 if (len(sys.argv) < 4):
      6     print "Usage: %s <service-name> <property> <value>" % (sys.argv[0])
      7     sys.exit(1)
      8 
      9 (_, name, property_key, value) = sys.argv
     10 
     11 flim = flimflam.FlimFlam()
     12 service = flim.FindElementByPropertySubstring('Service', 'Name', name)
     13 
     14 if not service:
     15     print "Could not find service: %s" % (sys.argv[1])
     16     sys.exit(1)
     17 
     18 if property_key in ["Priority"]:
     19     service.SetProperty(property_key, int(value))
     20 elif property_key in ["AutoConnect", "WiFi.HiddenSSID", "EAP.UseSystemCAs",
     21   "SaveCredentials", "LinkMonitorDisable", "ManagedCredentials"]:
     22     service.SetProperty(property_key,
     23                         dbus.Boolean(value.lower() in ("true", "1")))
     24 else:
     25     service.SetProperty(property_key, value)
     26