changeset 9:225885e803b4

Fixes
author Daniele Nicolodi <daniele@grinta.net>
date Mon, 11 Jan 2016 19:44:36 +0100
parents e8e76dcdec5c
children 636ea715af1e
files bnpparibas.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
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()