Changeset 113 for trunk

Show
Ignore:
Timestamp:
11/07/08 15:13:58 (2 months ago)
Author:
amcgregor
Message:

Made exceptions consistent by changing the Error suffix to Exception, solving ticket #85.

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_tm2_compatibility.py

    r109 r113  
    77 
    88import turbomail 
    9 from turbomail import Message, MailNotEnabledError 
     9from turbomail import Message, MailNotEnabledException 
    1010from turbomail.managers.immediate import ImmediateManager 
    1111from turbomail.providers.debug import DebugProviderFactory 
     
    5353        message = Message('from@example.com', 'to@example.com', 'Test') 
    5454        message.plain = 'Hello world!' 
    55         self.assertRaises(MailNotEnabledError, turbomail.enqueue, message) 
     55        self.assertRaises(MailNotEnabledException, turbomail.enqueue, message) 
    5656     
    5757    def test_message_enqueue(self): 
  • trunk/turbomail/control.py

    r102 r113  
    3131 
    3232 
    33 from turbomail.exceptions import MailNotEnabledError 
     33from turbomail.exceptions import MailNotEnabledException 
    3434 
    3535class ControlClass(object): 
     
    125125    def send(self, message): 
    126126        if not self.manager: 
    127             raise MailNotEnabledError 
     127            raise MailNotEnabledException 
    128128         
    129129        return self.manager.deliver(message) 
  • trunk/turbomail/exceptions.py

    r109 r113  
    44 
    55__version__ = "$Revision$" 
    6 __all__ = ['MailException', 'MailNotEnabledError', 'MailConfigurationError',  
     6__all__ = ['MailException', 'MailNotEnabledException', 'MailConfigurationException',  
    77           'ProviderException', 'ProviderExhaustedException', 'ManagerException'] 
    88 
     
    1414 
    1515 
    16 class MailNotEnabledError(MailException): 
     16class MailNotEnabledException(MailException): 
    1717    """Attempted to use TurboMail before being enabled.""" 
    1818     
     
    2323 
    2424 
    25 class MailConfigurationError(MailException): 
     25class MailConfigurationException(MailException): 
    2626    """There was an error in the configuration of TurboMail.""" 
    2727     
  • trunk/turbomail/providers/smtp.py

    r111 r113  
    1111 
    1212from turbomail.api import ProviderFactory, Provider 
    13 from turbomail.exceptions import MailConfigurationError, ProviderExhaustedException 
     13from turbomail.exceptions import MailConfigurationException, ProviderExhaustedException 
    1414from turbomail.control import interface 
    1515 
     
    3838        self.count = self.config_get("mail.smtp.count", default=10, tm2_key='jobs') 
    3939         
    40         # Defaults to localhost -- if self.server is None: raise MailConfigurationError, "You must define mail.smtp.server in your configuration." 
     40        # Defaults to localhost -- if self.server is None: raise MailConfigurationException, "You must define mail.smtp.server in your configuration." 
    4141         
    4242        self.connection = SMTP()