Mercurial > hg > bnpparibas
diff bnpparibas.py @ 9:225885e803b4
Fixes
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Mon, 11 Jan 2016 19:44:36 +0100 |
parents | 90f4e0bd0c2d |
children | 636ea715af1e |
line wrap: on
line diff
--- a/bnpparibas.py Mon Jan 11 19:17:38 2016 +0100 +++ b/bnpparibas.py Mon Jan 11 19:44:36 2016 +0100 @@ -6,6 +6,8 @@ import requests import smtplib import sqlite3 +import subprocess +import sys import textwrap import time @@ -16,7 +18,6 @@ from pprint import pprint from urllib.parse import urljoin -from bs4 import BeautifulSoup from html2text import HTML2Text from PIL import Image @@ -105,7 +106,7 @@ def encrypt(self, message, sender, recipient): sender = parseaddr(sender)[1] recipient = parseaddr(recipient)[1] - cmd = [ "gpg", "--homedir", self.homedir, "--sign", "--encrypt" + cmd = [ "gpg", "--homedir", self.homedir, "--sign", "--encrypt", "--batch", "--no-options", "--yes", "--armor", "--local-user", sender, "--recipient", recipient, ] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -305,7 +306,8 @@ return v['data'] -def main(conffile): +def main(): + conffile = sys.argv[1] conf = loadconf(conffile) db = sqlite3.connect(conf['DATABASE']) @@ -386,5 +388,4 @@ if __name__ == '__main__': - import sys - main(sys.argv[1]) + main()