Autocommit of file /home/julien/scripts/list-gnome-keyring-pwd.py changed on host...
[dotfiles/scripts.git] / list-gnome-keyring-pwd.py
1 #!/usr/bin/python
2
3 # source: http://blog.schmichael.com/2008/10/30/listing-all-passwords-stored-in-gnome-keyring/
4
5 import pygtk
6 pygtk.require('2.0')
7 import gtk # sets app name
8 import gnomekeyring
9  
10 def hack():
11     for keyring in gnomekeyring.list_keyring_names_sync():
12         for id in gnomekeyring.list_item_ids_sync(keyring):
13             item = gnomekeyring.item_get_info_sync(keyring, id)
14             print '[%s] %s = %s' % (
15                     keyring, item.get_display_name(), item.get_secret())
16         else:
17             if len(gnomekeyring.list_item_ids_sync(keyring)) == 0:
18                 print '[%s] --empty--' % keyring
19  
20 if __name__ == '__main__':
21     hack()