threads: errors management

This commit is contained in:
Romain Bignon 2010-04-29 11:08:08 +02:00
commit ff6c3f79ae
3 changed files with 56 additions and 25 deletions

View file

@ -18,15 +18,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
from __future__ import with_statement
import os
from logging import warning
from weboob.bcall import BackendsCall
from weboob.bcall import BackendsCall, CallErrors
from weboob.modules import ModulesLoader, BackendsConfig
from weboob.scheduler import Scheduler
__all__ = ['Weboob']
__all__ = ['Weboob', 'CallErrors']
class Weboob(object):
@ -93,7 +95,8 @@ class Weboob(object):
def iter_backends(self, caps=None):
for name, backend in self.backends.iteritems():
if caps is None or backend.has_caps(caps):
yield backend
with backend:
yield backend
def do(self, function, *args, **kwargs):
backends = [b for b in self.iter_backends()]