threads: errors management
This commit is contained in:
parent
7c502ca236
commit
ff6c3f79ae
3 changed files with 56 additions and 25 deletions
|
|
@ -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()]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue