| #!/usr/bin/python |
| |
| import dbus, flimflam, string, sys |
| |
| if (len(sys.argv) < 4): |
| print "Usage: %s <device-name> <property> <value>" % (sys.argv[0]) |
| sys.exit(1) |
| |
| (_, name, property, value) = sys.argv |
| |
| flim = flimflam.FlimFlam() |
| device = flim.FindElementByNameSubstring('Device', name) |
| if property in ["BgscanShortInterval", "ScanInterval" ]: |
| device.SetProperty(property, dbus.Int16(value)) |
| elif property in [ "BgscanSignalThreshold", ]: |
| device.SetProperty(property, int(value)) |
| elif property in ["Cellular.AllowRoaming", "Powered"]: |
| device.SetProperty(property, dbus.Boolean(value.lower() in ("true", "1"))) |
| else: |
| device.SetProperty(property, value) |