export_all works

This commit is contained in:
juke 2011-03-09 15:00:53 +01:00 committed by Romain Bignon
commit c06b4e07fe

View file

@ -34,7 +34,6 @@ class MessageFormatter(IFormatter):
pass
def format_dict(self, item):
print self.outfile
result = u'%sTitle:%s %s\n' % (self.BOLD,
self.NC, item['title'])
result += u'%sDate:%s %s\n' % (self.BOLD,
@ -157,7 +156,8 @@ class Boobmsg(ReplApplication):
}
COMMANDS_FORMATTERS = {'list': 'msglist',
'show': 'msg',
'export_thread': 'msg'
'export_thread': 'msg',
'export_all': 'msg'
}
@ -291,6 +291,19 @@ class Boobmsg(ReplApplication):
self.format(thread)
self.flush()
def do_export_all(self, arg):
"""
export_all
Export All threads
"""
cmd = self.do('iter_threads')
for backend, thread in cmd:
t = backend.get_thread(thread.id)
for msg in t.iter_all_messages():
self.format(msg)
def do_export_thread(self, arg):
"""
export_thread