From fc5ff1695cab0723c965d81579c9ce1b7a46ba59 Mon Sep 17 00:00:00 2001 From: pazz Date: Sun, 7 Aug 2011 17:14:26 +0100 Subject: pep8 --- alot/command.py | 18 ++++++++++-------- alot/settings.py | 6 ++++-- alot/ui.py | 4 +++- 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'alot') diff --git a/alot/command.py b/alot/command.py index 1db9b5d0..c66c6681 100644 --- a/alot/command.py +++ b/alot/command.py @@ -335,7 +335,7 @@ class ComposeCommand(Command): self.mail.attach(MIMEText('', 'plain', 'UTF-8')) else: self.mail = mail - for key,value in headers.items(): + for key, value in headers.items(): self.mail[key] = encode_header(key, value) def apply(self, ui): @@ -629,8 +629,8 @@ class SaveAttachmentCommand(Command): if self.all: msg = ui.current_buffer.get_selected_message() if not self.path: - self.path = ui.prompt(prefix='save attachments to:', text = - os.path.join('~', ''), + self.path = ui.prompt(prefix='save attachments to:', + text=os.path.join('~', ''), completer=pcomplete) if self.path: self.path = os.path.expanduser(self.path) @@ -674,6 +674,7 @@ class OpenAttachmentCommand(Command): cmd = handler % path.replace(' ', '\ ') else: cmd = '%s %s' % (handler, path.replace(' ', '\ ')) + def afterwards(): os.remove(path) ui.apply_command(ExternalCommand(cmd, on_success=afterwards, @@ -681,6 +682,7 @@ class OpenAttachmentCommand(Command): else: ui.notify('unknown mime type') + class ThreadSelectCommand(Command): def apply(self, ui): focus = ui.get_deep_focus() @@ -910,7 +912,7 @@ def interpret_commandline(cmdline, mode): # allow to shellescape without a space after '!' if cmd.startswith('!'): - params = cmd[1:] +' ' + params + params = cmd[1:] + ' ' + params cmd = 'shellescape' # check if this command makes sense in current mode @@ -921,12 +923,12 @@ def interpret_commandline(cmdline, mode): if cmd == 'search': return commandfactory(cmd, mode=mode, query=params) elif cmd == 'compose': - h ={} + h = {} if params: h = {'To': params} return commandfactory(cmd, mode=mode, headers=h) elif cmd == 'forward': - return commandfactory(cmd, mode=mode, inline=(params=='--inline')) + return commandfactory(cmd, mode=mode, inline=(params == '--inline')) elif cmd == 'prompt': return commandfactory(cmd, mode=mode, startstring=params) elif cmd == 'refine': @@ -942,9 +944,9 @@ def interpret_commandline(cmdline, mode): elif cmd == 'toggletag': return commandfactory(cmd, mode=mode, tag=params) elif cmd == 'fold': - return commandfactory(cmd, mode=mode, all=(params=='--all')) + return commandfactory(cmd, mode=mode, all=(params == '--all')) elif cmd == 'unfold': - return commandfactory(cmd, mode=mode, all=(params=='--all')) + return commandfactory(cmd, mode=mode, all=(params == '--all')) elif cmd == 'save': args = params.split(' ') allset = False diff --git a/alot/settings.py b/alot/settings.py index 296dce7f..4e5a567d 100644 --- a/alot/settings.py +++ b/alot/settings.py @@ -327,8 +327,10 @@ class CustomConfigParser(SafeConfigParser): hb = self.get('highcolour-theme', attr + '_bg', fallback='default') p.append((attr, nf, nb, m, hf, hb)) if attr.startswith('tag_') and attr + '_focus' not in names: - nb = self.get('normal-theme', 'threadline_focus_bg', fallback='default') - hb = self.get('highcolour-theme', 'threadline_focus_bg', fallback='default') + nb = self.get('normal-theme', 'threadline_focus_bg', + fallback='default') + hb = self.get('highcolour-theme', 'threadline_focus_bg', + fallback='default') p.append((attr + '_focus', nf, nb, m, hf, hb)) return p diff --git a/alot/ui.py b/alot/ui.py index 907d63e2..12e974ae 100644 --- a/alot/ui.py +++ b/alot/ui.py @@ -27,6 +27,7 @@ from command import interpret_commandline from widgets import CompleteEdit from completion import CommandLineCompleter + class MainWidget(urwid.Frame): def __init__(self, ui, *args, **kwargs): urwid.Frame.__init__(self, urwid.SolidFill(' '), *args, **kwargs) @@ -42,6 +43,7 @@ class MainWidget(urwid.Frame): else: urwid.Frame.keypress(self, size, key) + class UI: buffers = [] current_buffer = None @@ -205,7 +207,7 @@ class UI: def notify(self, message, priority='normal', timeout=0, block=True): def build_line(msg, prio): - cols =urwid.Columns([urwid.Text(msg)]) + cols = urwid.Columns([urwid.Text(msg)]) return urwid.AttrMap(cols, 'notify_' + prio) msgs = [build_line(message, priority)] if timeout == -1 and block: -- cgit v1.2.3