comparison src/bnpparibas.py @ 5:a47012c9db15

Fix
author Daniele Nicolodi <daniele@grinta.net>
date Wed, 25 Mar 2015 01:42:21 +0100
parents b4c2db70bbf2
children
comparison
equal deleted inserted replaced
4:b4c2db70bbf2 5:a47012c9db15
402 sender = parseaddr(sender)[1] 402 sender = parseaddr(sender)[1]
403 recipient = parseaddr(recipient)[1] 403 recipient = parseaddr(recipient)[1]
404 cmd = [ "gpg", "--homedir", self.homedir, "--batch", "--yes", "--no-options", "--armor", 404 cmd = [ "gpg", "--homedir", self.homedir, "--batch", "--yes", "--no-options", "--armor",
405 "--local-user", sender, "--recipient", recipient, "--sign", "--encrypt"] 405 "--local-user", sender, "--recipient", recipient, "--sign", "--encrypt"]
406 p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 406 p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
407 encdata, err = p.communicate(input=message.encode('utf-8'))[0].decode('ascii') 407 encdata, err = p.communicate(input=message.encode('utf-8'))
408 if p.returncode: 408 if p.returncode:
409 raise RuntimeError(p.returncode, err) 409 raise RuntimeError(p.returncode, err)
410 return encdata 410 return encdata.decode('ascii')
411 411
412 412
413 @click.command() 413 @click.command()
414 @click.argument('filename') 414 @click.argument('filename')
415 def main(filename): 415 def main(filename):