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 година
пре 6 година
пре 5 година
пре 6 година
пре 5 година
пре 6 година
12345678910111213141516
  1. import os.path
  2. import subprocess
  3. import distutils.spawn
  4. home = os.path.expanduser("~")
  5. def mailpasswd(acct):
  6. acct = os.path.basename(acct)
  7. path = "%s/.local/share/muttwizard/%s.gpg" % (home,acct)
  8. if distutils.spawn.find_executable("gpg"):
  9. GPG="gpg"
  10. else:
  11. GPG="gpg2"
  12. args = [GPG, "--use-agent", "--quiet", "--batch", "-d", path]
  13. try:
  14. return subprocess.check_output(args).strip().decode('UTF-8')
  15. except subprocess.CalledProcessError:
  16. return ""