Changeset 72

Show
Ignore:
Timestamp:
11/09/07 05:31:49 (1 year ago)
Author:
amcgregor
Message:

Fixes to get 3.0 working again. Now in use on GothCandy? for comment notification. It's in Flux, yo\!

Location:
branches/3.0/turbomail
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/3.0/turbomail/control.py

    r71 r72  
    6363                                self.stop(force=True) 
    6464                                return 
    65                         setattr(self, t, controller.load()) 
    66                         controller.start() 
     65                        setattr(self, t, controller) 
     66                        if hasattr(getattr(self, t), 'load'): 
     67                                setattr(self, t, getattr(self, t).load()) 
     68                        if hasattr(getattr(self, t), 'start'): 
     69                                getattr(self, t).start() 
    6770                 
    6871                # Load the requested manager and provider. 
  • branches/3.0/turbomail/managers/demand.py

    r68 r72  
    88log = logging.getLogger("turbomail.manager") 
    99 
    10 import turbomail 
     10from turbomail.exceptions import * 
    1111from turbomail.api import Manager 
    1212from turbomail.exceptions import ProviderExhaustedException 
     13from turbomail.control import interface as turbomail 
    1314 
    1415import math, copy 
    1516from Queue import Queue, Empty 
    1617from threading import Event, Thread 
    17 from turbomail.dispatch import Dispatch 
    1818 
    1919__all__ = ['load'] 
     
    8585         
    8686        def worker(self): 
    87                 log.debug("Requesting new provider instance.") 
     87                log.debug("Requesting new provider instance from.") 
    8888                provider = turbomail.provider.new() 
    8989                if not provider: raise ManagerException, "Unable to allocate new provider." 
  • branches/3.0/turbomail/message.py

    r68 r72  
    55__version__ = "$Revision$" 
    66 
    7 import turbomail 
    87from turbomail import release 
    98from turbomail.util import AddressList 
     9from turbomail.control import interface as turbomail 
    1010import re, os, email 
    1111 
  • branches/3.0/turbomail/providers/smtp.py

    r66 r72  
    99deliverylog = logging.getLogger("turbomail.delivery") 
    1010 
    11 import turbomail 
    12 from turbomail import config 
    1311from turbomail.api import ProviderFactory, Provider 
    1412from turbomail.exceptions import MailConfigurationError, ProviderExhaustedException 
     13from turbomail.control import interface as turbomail 
    1514 
    16 from smtplib import SMTP, SMTPRecipientsRefused, SMTPSenderRefused 
     15from smtplib import SMTP, SMTPRecipientsRefused, SMTPSenderRefused, SMTPServerDisconnected 
    1716 
    1817__all__ = ['load'] 
     
    2827                log.debug("Being created.") 
    2928                 
    30                 self.server = config.get("mail.smtp.server", "localhost") 
    31                 self.user = config.get("mail.smtp.user", None) 
    32                 self.password = config.get("mail.smtp.password", None) 
    33                 self.tls = config.get("mail.smtp.tls", None) 
    34                 self.debug = config.get("mail.smtp.debug", False) 
    35                 self.count = config.get("mail.smtp.count", 10) # The number of messages per connection. 
     29                self.server = turbomail.config.get("mail.smtp.server", "localhost") 
     30                self.user = turbomail.config.get("mail.smtp.user", None) 
     31                self.password = turbomail.config.get("mail.smtp.password", None) 
     32                self.tls = turbomail.config.get("mail.smtp.tls", None) 
     33                self.debug = turbomail.config.get("mail.smtp.debug", False) 
     34                self.count = turbomail.config.get("mail.smtp.count", 10) # The number of messages per connection. 
    3635                 
    3736                # Defaults to localhost -- if self.server is None: raise MailConfigurationError, "You must define mail.smtp.server in your configuration." 
     
    9594                 
    9695                except Exception, e: 
    97                         deliverylog.debug("%s EXCEPTION %s %s" % (message.id, e.__class__.__name__, e.message), exc_info=True) 
     96                        deliverylog.debug("%s EXCEPTION %s" % (message.id, e.__class__.__name__), exc_info=True) 
    9897                         
    9998                        if message.tries > 0: 
    100                                 deliverylog.warning("%s DEFERRED %s %s" % (message.id, e.__class__.__name__, e.message)) 
     99                                deliverylog.warning("%s DEFERRED %s" % (message.id, e.__class__.__name__)) 
    101100                                message.tries -= 1 
    102101                                turbomail.manager.deliver(message) 
    103102                                return 
    104103                        else: 
    105                                 deliverylog.error("%s REFUSED %s %s" % (message.id, e.__class__.__name__, e.message), exc_info=True) 
     104                                deliverylog.error("%s REFUSED %s" % (message.id, e.__class__.__name__), exc_info=True) 
    106105                                raise 
    107106                 
  • branches/3.0/turbomail/util.py

    r71 r72  
    99from turbomail.exceptions import MailNotEnabledError 
    1010from email.Header import Header 
    11 from email.utils import parseaddr, formataddr 
     11from email.Utils import parseaddr, formataddr 
    1212 
    1313__all__ = ['Address', 'AddressList']