From 8a59880ea9528abad78ae4054df3e0f2c9e3eecb Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 8 May 2011 16:42:49 +0200 Subject: [PATCH] use a function run in each backend thread --- weboob/applications/boobmsg/boobmsg.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/weboob/applications/boobmsg/boobmsg.py b/weboob/applications/boobmsg/boobmsg.py index fae7038e..9802f679 100644 --- a/weboob/applications/boobmsg/boobmsg.py +++ b/weboob/applications/boobmsg/boobmsg.py @@ -318,13 +318,16 @@ class Boobmsg(ReplApplication): Export All threads """ - cmd = self.do('iter_threads') - for backend, thread in cmd: - if not thread: - continue - t = backend.fillobj(thread, None) - for msg in t.iter_all_messages(): - self.format(msg) + def func(backend): + for thread in backend.iter_threads(): + if not thread: + continue + t = backend.fillobj(thread, None) + for msg in t.iter_all_messages(): + yield msg + + for backend, msg in self.do(func): + self.format(msg) def do_export_thread(self, arg): """