You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 年之前
1234567891011
  1. import os.path
  2. import subprocess
  3. home = os.path.expanduser("~")
  4. def mailpasswd(acct):
  5. acct = os.path.basename(acct)
  6. path = "%s/.config/mutt/credentials/%s.gpg" % (home,acct)
  7. args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path]
  8. try:
  9. return subprocess.check_output(args).strip()
  10. except subprocess.CalledProcessError:
  11. return ""