1.1 --- a/imiptools/__init__.py Tue Oct 17 23:30:18 2017 +0200
1.2 +++ b/imiptools/__init__.py Wed Oct 18 00:18:37 2017 +0200
1.3 @@ -25,7 +25,8 @@
1.4 from imiptools.content import handle_itip_part
1.5 from imiptools.data import get_address, get_addresses, get_uri
1.6 from imiptools.mail import Messenger
1.7 -from imiptools.stores import get_store, get_publisher, get_journal
1.8 +from imiptools.stores import get_store, get_publisher, get_journal, \
1.9 + StoreInitialisationError
1.10 import sys, os
1.11
1.12 # Postfix exit codes.
1.13 @@ -71,15 +72,21 @@
1.14
1.15 def get_publisher(self):
1.16
1.17 - "Return any configured publisher or None if not explicitly configured."
1.18 + "Return any configured publisher or None if not configured."
1.19
1.20 - return self.publishing_dir and get_publisher(self.publishing_dir) or None
1.21 + try:
1.22 + return get_publisher(self.publishing_dir)
1.23 + except StoreInitialisationError:
1.24 + return None
1.25
1.26 def get_journal(self):
1.27
1.28 - "Return any configured journal or None if not explicitly configured."
1.29 + "Return any configured journal or None if not configured."
1.30
1.31 - return self.journal_dir and get_journal(self.store_type, self.journal_dir) or None
1.32 + try:
1.33 + return get_journal(self.store_type, self.journal_dir)
1.34 + except StoreInitialisationError:
1.35 + return None
1.36
1.37 def process(self, f, original_recipients):
1.38