blob: 7ee63fb3112579a9135eae62e097a3fa6d38c23e [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:
print " -> delete failed"