Make CapCollection a bit more useable

Collections are not stored in replapplication.objects anymore, but in
replapplication.collections. This fixes the IDs issue. There was no gain
from storing them in objects.

Completion right after cd should be faster (and should always have been
like that, it was pretty much a bug).

The display of do_ls() should be much clearer. Collections are always at
the end, have ids/title/backend like objects (but using a formatter
would be better than my current hack).

There are still many issues with the current implementation.
refs #774
closes #785
This commit is contained in:
Laurent Bachelier 2012-02-12 15:49:08 +01:00
commit 9c5326c0e4
3 changed files with 42 additions and 24 deletions

View file

@ -24,6 +24,7 @@ from copy import copy
from threading import Thread, Event, RLock, Timer
from weboob.capabilities.base import CapBaseObject
from weboob.capabilities.collection import Collection
from weboob.tools.misc import get_backtrace
from weboob.tools.log import getLogger
@ -92,6 +93,7 @@ class BackendsCall(object):
if isinstance(result, CapBaseObject):
if self.condition and not self.condition.is_valid(result):
return
if isinstance(result, (CapBaseObject, Collection)):
result.backend = backend.name
self.responses.append((backend, result))
self.response_event.set()