/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/smtp_connection.py

  • Committer: Jelmer Vernooij
  • Date: 2017-07-16 01:55:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6740.
  • Revision ID: jelmer@jelmer.uk-20170716015539-esj2f7vjje9366u0
Fix more imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    osutils,
29
29
    )
30
30
from .errors import (
31
 
    NoDestinationAddress,
32
 
    SMTPError,
33
 
    DefaultSMTPConnectionRefused,
34
 
    SMTPConnectionRefused,
 
31
    BzrError,
 
32
    InternalBzrError,
35
33
    )
36
34
 
37
35
 
49
47
''')
50
48
 
51
49
 
 
50
class SMTPError(BzrError):
 
51
 
 
52
    _fmt = "SMTP error: %(error)s"
 
53
 
 
54
    def __init__(self, error):
 
55
        self.error = error
 
56
 
 
57
 
 
58
class SMTPConnectionRefused(SMTPError):
 
59
 
 
60
    _fmt = "SMTP connection to %(host)s refused"
 
61
 
 
62
    def __init__(self, error, host):
 
63
        self.error = error
 
64
        self.host = host
 
65
 
 
66
 
 
67
class DefaultSMTPConnectionRefused(SMTPConnectionRefused):
 
68
 
 
69
    _fmt = "Please specify smtp_server.  No server at default %(host)s."
 
70
 
 
71
 
 
72
 
 
73
class NoDestinationAddress(InternalBzrError):
 
74
 
 
75
    _fmt = "Message does not have a destination address."
 
76
 
 
77
 
 
78
 
52
79
class SMTPConnection(object):
53
80
    """Connect to an SMTP server and send an email.
54
81