blob: 4e7c14935bbf3b8ed4f13d500f340cf8f282a74c [file] [log] [blame]
#!/usr/bin/python
import dbus, sys
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.chromium.flimflam", "/"),
"org.chromium.flimflam.Manager")
profile_path = None
if (len(sys.argv) < 2):
print "Usage: %s <identifier> [<profile path>]" % (sys.argv[0])
sys.exit(1)
elif (len(sys.argv) > 2):
profile_path = sys.argv[2]
properties = manager.GetProperties(utf8_strings = True)
active = properties["ActiveProfile"]
for path in properties["Profiles"]:
if (active == path):
print "[ %s ] <== active" % (path)
else:
print "[ %s ]" % (path)
profile = dbus.Interface(bus.get_object("org.chromium.flimflam", path),
"org.chromium.flimflam.Profile")
if profile_path is None or path == profile_path:
try:
profile.DeleteEntry(sys.argv[1])
print " -> delete succeeded"
except Exception, e:
print " -> delete failed"