diff options
author | Lucas Hoffmann <l-m-h@web.de> | 2017-01-19 09:47:42 +0100 |
---|---|---|
committer | Lucas Hoffmann <l-m-h@web.de> | 2017-01-20 13:37:39 +0100 |
commit | 1af4c5e65483ef0907d91094e2dac1d546fc6f67 (patch) | |
tree | d5b561fc4fd4b057bf44ca137bad0bdd7fe7c3c6 /alot/account.py | |
parent | d2497661acdb9ec0c24d672b5226da6d16f2fec3 (diff) |
Add docstrings to some methods and functions.
Diffstat (limited to 'alot/account.py')
-rw-r--r-- | alot/account.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/alot/account.py b/alot/account.py index 5e66e9bf..c8b83418 100644 --- a/alot/account.py +++ b/alot/account.py @@ -178,6 +178,7 @@ class Account(object): class SendmailAccount(Account): """:class:`Account` that pipes a message to a `sendmail` shell command for sending""" + def __init__(self, cmd, **kwargs): """ :param cmd: sendmail command to use for this account @@ -187,13 +188,22 @@ class SendmailAccount(Account): self.cmd = cmd def send_mail(self, mail): + """Pipe the given mail to the configured sendmail command. Display a + short message on success or a notification on error. + :param mail: the mail to send out + :type mail: str + :returns: the deferred that calls the sendmail command + :rtype: `twisted.internet.defer.Deferred` + """ cmdlist = split_commandstring(self.cmd) def cb(out): + """The callback used on success.""" logging.info('sent mail successfully') logging.info(out) def errb(failure): + """The callback used on error.""" termobj = failure.value errmsg = '%s failed with code %s:\n%s' % \ (self.cmd, termobj.exitCode, str(failure.value)) |