瀏覽代碼

gpg autodetermined in python script

tags/v3.1
Luke Smith 5 年之前
父節點
當前提交
de6bd6e5b0
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4C50B54A911F6252
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. +6
    -1
      bin/imappwd.py

+ 6
- 1
bin/imappwd.py 查看文件

@@ -1,10 +1,15 @@
import os.path
import subprocess
import distutils.spawn
home = os.path.expanduser("~")
def mailpasswd(acct):
acct = os.path.basename(acct)
path = "%s/.local/share/muttwizard/%s.gpg" % (home,acct)
args = ["gpg2", "--use-agent", "--quiet", "--batch", "-d", path]
if distutils.spawn.find_executable("gpg"):
GPG="gpg"
else:
GPG="gpg2"
args = [GPG, "--use-agent", "--quiet", "--batch", "-d", path]
try:
return subprocess.check_output(args).strip().decode('UTF-8')
except subprocess.CalledProcessError:


Loading…
取消
儲存