mutt/offlineimap.py @ 95735c27a0c0

vim: Goodbye, taglist.  I never used you.
author Steve Losh <steve@stevelosh.com>
date Tue, 08 Feb 2011 16:51:47 -0500
parents a897edaa3e97
children c6446e280dab
#!/usr/bin/python
import re, commands
def get_keychain_pass(account=None, server=None):
    params = {
        'security': '/usr/bin/security',
        'command': 'find-internet-password',
        'account': account,
        'server': server
    }
    command = "%(security)s %(command)s -g -a %(account)s -s %(server)s" % params
    outtext = commands.getoutput(command)
    return re.match(r'password: "(.*)"', outtext).group(1)