# HG changeset patch # User Paul Boddie # Date 1422895081 -3600 # Node ID a494789967a2a7dfebec29cd17040468225b519f # Parent 89aba75b757d1bfd52884eb84611c4a9cc9d5060 Make a handlers dictionary at the top level. diff -r 89aba75b757d -r a494789967a2 imiptools/__init__.py --- a/imiptools/__init__.py Mon Feb 02 17:29:58 2015 +0100 +++ b/imiptools/__init__.py Mon Feb 02 17:38:01 2015 +0100 @@ -83,7 +83,7 @@ all_responses = [] handled = False - handlers = [(name, cls(senders, recipient, self.messenger)) for name, cls in self.handlers] + handlers = dict([(name, cls(senders, recipient, self.messenger)) for name, cls in self.handlers]) for part in msg.walk(): if part.get_content_type() in itip_content_types and \ diff -r 89aba75b757d -r a494789967a2 imiptools/content.py --- a/imiptools/content.py Mon Feb 02 17:29:58 2015 +0100 +++ b/imiptools/content.py Mon Feb 02 17:38:01 2015 +0100 @@ -136,13 +136,12 @@ def handle_itip_part(part, handlers): """ - Handle the given iTIP 'part' using the given 'handlers'. + Handle the given iTIP 'part' using the given 'handlers' dictionary. Return a list of responses, each response being a tuple of the form (outgoing-recipients, message-part). """ - handlers = dict(handlers) method = part.get_param("method") # Decode the data and parse it.