From c06b4e07fee5e754b1ea8bcaf8c6b777227506d1 Mon Sep 17 00:00:00 2001 From: juke Date: Wed, 9 Mar 2011 15:00:53 +0100 Subject: [PATCH] export_all works --- weboob/applications/boobmsg/boobmsg.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/weboob/applications/boobmsg/boobmsg.py b/weboob/applications/boobmsg/boobmsg.py index b6ce0d9f..3ce501e4 100644 --- a/weboob/applications/boobmsg/boobmsg.py +++ b/weboob/applications/boobmsg/boobmsg.py @@ -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