summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/addressbook/external.py4
-rw-r--r--alot/helper.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/alot/addressbook/external.py b/alot/addressbook/external.py
index 93e76784..eea70cbc 100644
--- a/alot/addressbook/external.py
+++ b/alot/addressbook/external.py
@@ -6,6 +6,7 @@ import re
from ..helper import call_cmd
from ..helper import split_commandstring
from . import AddressBook, AddressbookError
+import logging
class ExternalAddressbook(AddressBook):
@@ -59,9 +60,11 @@ class ExternalAddressbook(AddressBook):
raise AddressbookError(msg)
if not resultstring:
+ logging.debug("No contacts in address book (empty string)")
return []
lines = resultstring.splitlines()
res = []
+ logging.debug("Apply %s on %d results" % (self.regex, len(lines)))
for l in lines:
m = re.match(self.regex, l, self.reflags)
if m:
@@ -70,4 +73,5 @@ class ExternalAddressbook(AddressBook):
email = info['email'].strip()
name = info['name']
res.append((name, email))
+ logging.debug("New match name=%s mail=%s" % (name, email))
return res
diff --git a/alot/helper.py b/alot/helper.py
index 9992e6c8..94ea108c 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -276,6 +276,8 @@ def call_cmd(cmdlist, stdin=None):
if isinstance(stdin, str):
stdin = stdin.encode(termenc)
try:
+
+ logging.debug("Calling %s" % cmdlist)
proc = subprocess.Popen(
cmdlist,
stdout=subprocess.PIPE,