From 9b8b8f5a68270912ac0dc8f16d320729b25d2da8 Mon Sep 17 00:00:00 2001 From: Johannes Kulick Date: Wed, 19 Dec 2012 11:54:56 +0100 Subject: add error codes to avoid import ui stuff to crypto.py I added error codes to the GPGProblem Exceptions. This way I can process them later, depending on the error code --- alot/commands/envelope.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'alot/commands') diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index 4c3f1e5f..a4a978f4 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -12,7 +12,7 @@ from twisted.internet.defer import inlineCallbacks import datetime from alot.account import SendingMailFailed, StoreMailError -from alot.errors import GPGProblem +from alot.errors import GPGProblem, GPGCode from alot import buffers from alot import commands from alot import crypto @@ -484,7 +484,7 @@ class EncryptCommand(Command): for keyid in self.encrypt_keys: tmp_key = crypto.get_key(keyid) del envelope.encrypt_keys[crypto.hash_key(tmp_key)] - except gpgme.GpgmeError as e: + except GPGProblem as e: ui.notify(e.message, priority='error') if not envelope.encrypt_keys: envelope.encrypt = False -- cgit v1.2.3