Move condition from BCall to Repl
This commit is contained in:
parent
c97f33633a
commit
6b0930ffc5
2 changed files with 3 additions and 2 deletions
|
|
@ -98,8 +98,6 @@ class BackendsCall(object):
|
||||||
def _store_result(self, backend, result):
|
def _store_result(self, backend, result):
|
||||||
with self.mutex:
|
with self.mutex:
|
||||||
if isinstance(result, CapBaseObject):
|
if isinstance(result, CapBaseObject):
|
||||||
if self.condition and not self.condition.is_valid(result):
|
|
||||||
return
|
|
||||||
result.backend = backend.name
|
result.backend = backend.name
|
||||||
self.responses.append((backend, result))
|
self.responses.append((backend, result))
|
||||||
self.response_event.set()
|
self.response_event.set()
|
||||||
|
|
|
||||||
|
|
@ -1109,6 +1109,9 @@ class ReplApplication(Cmd, ConsoleApplication):
|
||||||
|
|
||||||
def format(self, result, alias=None):
|
def format(self, result, alias=None):
|
||||||
fields = self.selected_fields
|
fields = self.selected_fields
|
||||||
|
# Do not format objects if they not respect conditions
|
||||||
|
if self.condition and not self.condition.is_valid(result):
|
||||||
|
return
|
||||||
if '$direct' in fields or '$full' in fields:
|
if '$direct' in fields or '$full' in fields:
|
||||||
fields = None
|
fields = None
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue