diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-09-09 17:21:15 +0200 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-09-09 17:21:15 +0200 |
commit | a06f894574ac938ed6c19d75a0d6ce42ef069ac7 (patch) | |
tree | 3ee296c6c57ed4a8d66d8e852d71806eb1ccee7c /alot | |
parent | f91371eaae687b5fd66c26e22679d09e91e9620f (diff) |
cleanup: pep8/pyflakes fixes
Diffstat (limited to 'alot')
-rw-r--r-- | alot/commands/thread.py | 4 | ||||
-rw-r--r-- | alot/completion.py | 5 | ||||
-rw-r--r-- | alot/helper.py | 8 | ||||
-rw-r--r-- | alot/utils/booleanaction.py | 1 | ||||
-rw-r--r-- | alot/widgets/globals.py | 3 |
5 files changed, 12 insertions, 9 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 96f3a287..58f6b4ef 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -318,8 +318,8 @@ class EditNewCommand(Command): (['--all'], {'action': 'store_true', 'help':'affect all messages'})], help='display message source') @registerCommand(MODE, 'toggleheaders', forced={'all_headers': 'toggle'}, - arguments=[ (['--all'], {'action': 'store_true', - 'help':'affect all messages'})], + arguments=[(['--all'], {'action': 'store_true', + 'help':'affect all messages'})], help='display all headers') class ChangeDisplaymodeCommand(Command): """fold or unfold messages""" diff --git a/alot/completion.py b/alot/completion.py index 29fd368c..647266e1 100644 --- a/alot/completion.py +++ b/alot/completion.py @@ -409,7 +409,10 @@ class CommandCompleter(Completer): # prepend cmd and correct position res = [('%s %s' % (cmd, t), p + len(cmd) + 1) for (t, p) in res] - res = [(' ' * whitespaceoffset + cmd, p + whitespaceoffset) for cmd, p in res] + # re-insert whitespaces and correct position + wso = whitespaceoffset + res = [(' ' * wso + cmd, p + wso) for cmd, p + in res] return res diff --git a/alot/helper.py b/alot/helper.py index 973443b0..6cb8d82c 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -29,7 +29,7 @@ def split_commandline(s, comments=False, posix=True): splits semi-colon separated commandlines """ # shlex seems to remove unescaped quotes - s = s.replace('\'','\\\'') + s = s.replace('\'', '\\\'') # encode s to utf-8 for shlex if isinstance(s, unicode): s = s.encode('utf-8') @@ -200,8 +200,8 @@ def shorten_author_string(authors_string, maxlength): # that if any author will be hidden, and ellipsis should be added while authors and remaining_length >= 3: au = authors.pop() - if len(au) > 1 and (remaining_length == 3 or - (authors and remaining_length < 7)): + if len(au) > 1 and (remaining_length == 3 or (authors and + remaining_length < 7)): authors_chain.appendleft(u'\u2026') break else: @@ -346,7 +346,7 @@ def call_cmd_async(cmdlist, stdin=None, env=None): d = Deferred() environment = os.environ - if env != None: + if env is not None: environment.update(env) logging.debug('ENV = %s' % environment) logging.debug('CMD = %s' % cmdlist) diff --git a/alot/utils/booleanaction.py b/alot/utils/booleanaction.py index 30901e08..82fcedd2 100644 --- a/alot/utils/booleanaction.py +++ b/alot/utils/booleanaction.py @@ -2,7 +2,6 @@ # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import argparse -import re TRUEISH = ['true', 'yes', 'on', '1', 't', 'y'] diff --git a/alot/widgets/globals.py b/alot/widgets/globals.py index 46ed6f3a..d9e7fadb 100644 --- a/alot/widgets/globals.py +++ b/alot/widgets/globals.py @@ -39,7 +39,8 @@ class AttachmentWidget(urwid.WidgetWrap): class ChoiceWidget(urwid.Text): - def __init__(self, choices, callback, cancel=None, select=None, separator=' '): + def __init__(self, choices, callback, cancel=None, select=None, + separator=' '): self.choices = choices self.callback = callback self.cancel = cancel |