- Timestamp:
- 11/02/08 13:15:29 (2 months ago)
- Location:
- trunk/turbomail
- Files:
-
- 3 modified
-
api.py (modified) (3 diffs)
-
managers/immediate.py (modified) (1 diff)
-
providers/smtp.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/turbomail/api.py
r109 r111 48 48 49 49 class Provider(object): 50 """docstring for Provider""" 50 """A Provider can deliver messages towards their recipients with a specific 51 method, e.g. SMTP. They don't care about delivery strategies like queing or 52 batch submission.""" 53 51 54 def __init__(self): 52 55 super(Provider, self).__init__() … … 57 60 58 61 def config_get(self, key, default=None, tm2_key=None): 59 """Returns the configuration """ 62 """Returns the value for the given key from the configuration. If the 63 value was not found, the default value (default None) is returned. If 64 tm2_key was specified, """ 60 65 if key in interface.config: 61 66 value = interface.config.get(key) … … 74 79 return value 75 80 81 82 def stop(self): 83 """Called by the manager before the provider instance is destroyed. The 84 provider can do some final cleanups (like releasing external resources) 85 here.""" 86 pass 76 87 77 88 -
trunk/turbomail/managers/immediate.py
r93 r111 52 52 except ProviderExhaustedException: 53 53 log.debug("Provider exhausted.") 54 self.provider.stop() 54 55 self.provider = None 55 56 self.deliver(message) -
trunk/turbomail/providers/smtp.py
r109 r111 64 64 self.connection.login(self.user, self.password) 65 65 66 def __del__(self):66 def stop(self): 67 67 log.debug("Closing SMTP connection.") 68 69 68 if self.connected: 70 69 self.connection.quit()
