diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-09-22 20:50:27 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-09-22 20:50:27 +0100 |
commit | 36a3ff22e03a070cd5f4d9594ed4fb15d9f4cfe8 (patch) | |
tree | e221abe22765701005f94b2a178c053d6af42de4 /alot | |
parent | aabed014016e8baff114f8f403904746e3e065e6 (diff) |
pep8 fixes
Diffstat (limited to 'alot')
-rw-r--r-- | alot/addressbooks.py | 3 | ||||
-rw-r--r-- | alot/commands/envelope.py | 17 | ||||
-rw-r--r-- | alot/commands/thread.py | 6 | ||||
-rw-r--r-- | alot/completion.py | 3 |
4 files changed, 17 insertions, 12 deletions
diff --git a/alot/addressbooks.py b/alot/addressbooks.py index 7767e597..d3f64b6c 100644 --- a/alot/addressbooks.py +++ b/alot/addressbooks.py @@ -31,7 +31,8 @@ class AddressBook(object): query = '.*%s.*' % query for name, email in self.get_contacts(): try: - if re.match(query, name, self.reflags) or re.match(query, email, self.reflags): + if re.match(query, name, self.reflags) or \ + re.match(query, email, self.reflags): res.append((name, email)) except: pass diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py index 614061f6..c461002e 100644 --- a/alot/commands/envelope.py +++ b/alot/commands/envelope.py @@ -118,8 +118,8 @@ class SendCommand(Command): """ :param mail: email to send :type email: email.message.Message - :param envelope: envelope to use to construct the outgoing mail. - This will be ignored in case the mail parameter is set. + :param envelope: envelope to use to construct the outgoing mail. This + will be ignored in case the mail parameter is set. :type envelope: alot.db.envelope.envelope """ Command.__init__(self, **kwargs) @@ -131,22 +131,25 @@ class SendCommand(Command): def apply(self, ui): if self.mail is None: if self.envelope is None: - self.envelope_buffer = ui.current_buffer # needed to close later + # needed to close later + self.envelope_buffer = ui.current_buffer self.envelope = self.envelope_buffer.envelope # This is to warn the user before re-sending # an already sent message in case the envelope buffer # was not closed because it was the last remaining buffer. if self.envelope.sent_time: - warning = 'A modified version of ' * self.envelope.modified_since_sent - warning += 'this message has been sent at %s.' % self.envelope.sent_time + mod = self.envelope.modified_since_sent + when = self.envelope.sent_time + warning = 'A modified version of ' * mod + warning += 'this message has been sent at %s.' % when warning += ' Do you want to resend?' if (yield ui.choice(warning, cancel='no', msg_position='left')) == 'no': return - # don't do anything if another SendCommand is in the middle of sending - # the message and we were triggered accidentally + # don't do anything if another SendCommand is in the middle of + # sending the message and we were triggered accidentally if self.envelope.sending: msg = 'sending this message already!' logging.debug(msg) diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 82043b44..1ee2d933 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -67,14 +67,14 @@ def determine_sender(mail, action='reply'): # and use that accounts realname and the found recipient address for account in my_accounts: acc_addresses = account.get_addresses() - for alias_re in acc_addresses: + for alias in acc_addresses: if realname is not None: break - regex = re.compile(alias_re) + regex = re.compile(alias) for rec in recipients: seen_name, seen_address = parseaddr(rec) if regex.match(seen_address): - logging.debug("match!: '%s' '%s'" % (seen_address, alias_re)) + logging.debug("match!: '%s' '%s'" % (seen_address, alias)) if settings.get(action + '_force_realname'): realname = account.realname else: diff --git a/alot/completion.py b/alot/completion.py index c3bc60d6..1d523326 100644 --- a/alot/completion.py +++ b/alot/completion.py @@ -381,7 +381,8 @@ class CommandCompleter(Completer): plist = params.split(' ', 1) if len(plist) == 1: # complete from header keys localprefix = params - headers = ['Subject', 'To', 'Cc', 'Bcc', 'In-Reply-To', 'From'] + headers = ['Subject', 'To', 'Cc', 'Bcc', 'In-Reply-To', + 'From'] localcompleter = StringlistCompleter(headers) localres = localcompleter.complete(localprefix, localpos) res = [(c, p + 6) for (c, p) in localres] |