summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-10-02 17:41:38 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-10-02 17:41:38 +0100
commitc8501b8ac750752a9d391d90d09761faa958fb58 (patch)
tree58f56bc784db2bb69cedb64cc8995cffbdfa1555 /alot
parent4926a655feafd039fd34a9e273fd168f9d14b0a1 (diff)
parentc6a744f9b0453bd1e2552a52a8b6db4468617ef0 (diff)
Merge branch 'master' of github.com:pazz/alot
Conflicts: alot/init.py
Diffstat (limited to 'alot')
-rw-r--r--alot/account.py4
-rw-r--r--alot/buffer.py8
-rw-r--r--alot/command.py7
-rw-r--r--alot/helper.py1
-rwxr-xr-xalot/init.py10
-rw-r--r--alot/message.py1
-rw-r--r--alot/ui.py9
-rw-r--r--alot/walker.py3
-rw-r--r--alot/widgets.py2
9 files changed, 13 insertions, 32 deletions
diff --git a/alot/account.py b/alot/account.py
index 88019f55..fa47b177 100644
--- a/alot/account.py
+++ b/alot/account.py
@@ -18,8 +18,6 @@ Copyright (C) 2011 Patrick Totzke <patricktotzke@gmail.com>
"""
import mailbox
-import shlex
-import subprocess
import logging
import time
import re
@@ -110,7 +108,7 @@ class Account(object):
msg.set_flags('S')
else:
msg = mailbox.Message(mail)
- key = mbx.add(mail)
+ mbx.add(mail)
mbx.flush()
mbx.unlock()
diff --git a/alot/buffer.py b/alot/buffer.py
index 77eef99e..a1a4fc67 100644
--- a/alot/buffer.py
+++ b/alot/buffer.py
@@ -152,9 +152,10 @@ class SearchBuffer(Buffer):
def rebuild(self):
if self.isinitialized:
- focusposition = self.threadlist.get_focus()[1]
+ pass
+ #focusposition = self.threadlist.get_focus()[1]
else:
- focusposition = 0
+ #focusposition = 0
self.isinitialized = True
self.result_count = self.dbman.count_messages(self.querystring)
@@ -258,9 +259,6 @@ class ThreadBuffer(Buffer):
msg.remove_tags(['unread'])
self.ui.apply_command(command.FlushCommand())
- def get_message_widgets(self):
- return self.body.body.contents
-
class TagListBuffer(Buffer):
def __init__(self, ui, alltags=[], filtfun=None):
diff --git a/alot/command.py b/alot/command.py
index 5c689a55..58020b35 100644
--- a/alot/command.py
+++ b/alot/command.py
@@ -26,11 +26,8 @@ import subprocess
import shlex
import email
import tempfile
-import mimetypes
-from email.parser import Parser
from email import Charset
from email.header import Header
-from email.message import Message
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import urwid
@@ -347,7 +344,6 @@ class ToggleThreadTagCommand(Command):
#remove line from searchlist if thread doesn't match the query
qs = "(%s) AND thread:%s" % (cb.querystring,
self.thread.get_thread_id())
- msg_count = ui.dbman.count_messages(qs)
if ui.dbman.count_messages(qs) == 0:
ui.logger.debug('remove: %s' % self.thread)
cb.threadlist.remove(threadwidget)
@@ -448,12 +444,11 @@ class RetagCommand(Command):
self.thread = ui.current_buffer.get_selected_thread()
if not self.thread:
return
- initial_tagstring = ','.join(self.thread.get_tags())
tags = filter(lambda x: x, self.tagsstring.split(','))
ui.logger.info("got %s:%s" % (self.tagsstring, tags))
try:
self.thread.set_tags(tags)
- except DatabaseROError, e:
+ except DatabaseROError:
ui.notify('index in read-only mode', priority='error')
return
diff --git a/alot/helper.py b/alot/helper.py
index 95c7f06a..785284cd 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -29,7 +29,6 @@ from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from email.mime.text import MIMEText
-from email.mime.multipart import MIMEMultipart
import urwid
diff --git a/alot/init.py b/alot/init.py
index 563c998f..02d163e3 100755
--- a/alot/init.py
+++ b/alot/init.py
@@ -107,11 +107,11 @@ def main():
cmd = interpret_commandline(default_commandline, 'global')
# set up and start interface
- ui = UI(dbman,
- logger,
- aman,
- cmd,
- args.colours,
+ UI(dbman,
+ logger,
+ aman,
+ query,
+ args.colours,
)
if __name__ == "__main__":
diff --git a/alot/message.py b/alot/message.py
index 75895456..4f473172 100644
--- a/alot/message.py
+++ b/alot/message.py
@@ -164,7 +164,6 @@ class Message(object):
def get_text_content(self):
res = ''
for part in self.get_email().walk():
- ctype = part.get_content_type()
enc = part.get_content_charset()
if part.get_content_maintype() == 'text':
raw_payload = part.get_payload(decode=True)
diff --git a/alot/ui.py b/alot/ui.py
index d58b561c..7bf5ed7b 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -17,7 +17,6 @@ along with notmuch. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2011 Patrick Totzke <patricktotzke@gmail.com>
"""
import urwid
-import os
from urwid.command_map import command_map
from twisted.internet import defer
@@ -119,7 +118,7 @@ class UI(object):
('fixed', len(prefix), leftpart),
('weight', 1, editpart),
])
- prompt_widget = urwid.AttrMap(both, 'prompt', 'prompt')
+ urwid.AttrMap(both, 'prompt', 'prompt')
# put promptwidget as overlay on main widget
overlay = urwid.Overlay(both, main,
@@ -230,7 +229,6 @@ class UI(object):
:param messages: The popups to remove. This should be exactly
what notify() returned
"""
- footer = self.mainframe.get_footer()
newpile = self.notificationbar.widget_list
for l in messages:
newpile.remove(l)
@@ -281,7 +279,7 @@ class UI(object):
], dividechars=1)
else: # above
both = urwid.Pile([msgpart, choicespart])
- prompt_widget = urwid.AttrMap(both, 'prompt', 'prompt')
+ urwid.AttrMap(both, 'prompt', 'prompt')
# put promptwidget as overlay on main widget
overlay = urwid.Overlay(both, main,
@@ -315,7 +313,6 @@ class UI(object):
if timeout == -1 and block:
msgs.append(build_line('(hit any key to proceed)', 'normal'))
- footer = self.mainframe.get_footer()
if not self.notificationbar:
self.notificationbar = urwid.Pile(msgs)
else:
@@ -328,7 +325,7 @@ class UI(object):
self.mainloop.draw_screen()
if block:
- keys = self.mainloop.screen.get_input()
+ self.mainloop.screen.get_input()
clear()
else:
if timeout >= 0:
diff --git a/alot/walker.py b/alot/walker.py
index 2a410db9..d7869ef7 100644
--- a/alot/walker.py
+++ b/alot/walker.py
@@ -18,9 +18,6 @@ Copyright (C) 2011 Patrick Totzke <patricktotzke@gmail.com>
"""
import urwid
-from notmuch import NotmuchError
-
-
class IteratorWalker(urwid.ListWalker):
def __init__(self, it, containerclass, **kwargs):
self.kwargs = kwargs
diff --git a/alot/widgets.py b/alot/widgets.py
index 092a414a..14d97d6c 100644
--- a/alot/widgets.py
+++ b/alot/widgets.py
@@ -341,8 +341,6 @@ class MessageWidget(urwid.WidgetWrap):
self.attachmentw = urwid.Pile(lines)
return self.attachmentw
- attachments = message.get_attachments()
-
def _get_body_widget(self):
"""creates/returns the widget that displays the mail body"""
if not self.bodyw: