1.1 --- a/imiptools/__init__.py Tue Jan 31 15:49:14 2017 +0100
1.2 +++ b/imiptools/__init__.py Tue Jan 31 15:53:41 2017 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 A processing framework for iMIP content.
1.6
1.7 -Copyright (C) 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2014, 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -20,7 +20,7 @@
1.13 """
1.14
1.15 from email import message_from_file
1.16 -from imiptools import config
1.17 +from imiptools.config import settings
1.18 from imiptools.client import Client
1.19 from imiptools.content import handle_itip_part
1.20 from imiptools.data import get_address, get_addresses, get_uri
1.21 @@ -106,7 +106,7 @@
1.22 # None and deduced from the object content later.
1.23
1.24 else:
1.25 - senders = [sender for sender in get_addresses(get_all_values(msg, "From") or []) if sender != config.MESSAGE_SENDER]
1.26 + senders = [sender for sender in get_addresses(get_all_values(msg, "From") or []) if sender != settings["MESSAGE_SENDER"]]
1.27 Recipient(senders and senders[0] or None, messenger, store, publisher, journal, preferences_dir, self.handlers, self.outgoing_only, self.debug
1.28 ).process(msg, senders)
1.29
1.30 @@ -189,7 +189,7 @@
1.31 getvalue = lambda value, default=None: value and value[0] or default
1.32
1.33 self.messenger = Messenger(lmtp_socket=getvalue(lmtp), local_smtp=local_smtp, sender=getvalue(senders))
1.34 - self.store_type = getvalue(store_type, config.STORE_TYPE)
1.35 + self.store_type = getvalue(store_type, settings["STORE_TYPE"])
1.36 self.store_dir = getvalue(store_dir)
1.37 self.publishing_dir = getvalue(publishing_dir)
1.38 self.preferences_dir = getvalue(preferences_dir)
1.39 @@ -198,7 +198,7 @@
1.40 # If debug mode is set, extend the line length for convenience.
1.41
1.42 if self.debug:
1.43 - config.CALENDAR_LINE_LENGTH = 1000
1.44 + settings["CALENDAR_LINE_LENGTH"] = 1000
1.45
1.46 # Process the input.
1.47
1.48 @@ -381,7 +381,7 @@
1.49 # Determine whether to wrap, accompany or replace the message.
1.50
1.51 prefs = self.get_preferences()
1.52 - incoming = prefs.get("incoming", config.INCOMING_DEFAULT)
1.53 + incoming = prefs.get("incoming", settings["INCOMING_DEFAULT"])
1.54
1.55 if incoming == "message-only":
1.56 messages = [msg]