| #!/usr/bin/python |
| |
| # Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import dbus, flimflam |
| |
| def main(): |
| """ Pop and remove all profiles until 'default' is found. """ |
| flim = flimflam.FlimFlam(dbus.SystemBus()) |
| while True: |
| active = flim.GetActiveProfile() |
| properties = active.GetProperties(utf8_strings = True) |
| # Convert a DBus type to a string. |
| active_name = str(properties['Name']) |
| if active_name == 'default': |
| break |
| else: |
| print 'Removing profile: %s' % active_name |
| flim.PopProfile(active_name) |
| flim.RemoveProfile(active_name) |
| |
| if __name__ == '__main__': |
| main() |