# HG changeset patch # User Daniele Nicolodi # Date 1452537876 -3600 # Node ID 225885e803b48c4092b6dfc90d743d36db30daee # Parent e8e76dcdec5c6c60ad2ecd99734741a1e7b05629 Fixes diff -r e8e76dcdec5c -r 225885e803b4 bnpparibas.py --- 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()