gather collections having the same path
This commit is contained in:
parent
b140b3fa09
commit
7b799a6fbb
1 changed files with 17 additions and 0 deletions
|
|
@ -1029,6 +1029,7 @@ class ReplApplication(Cmd, ConsoleApplication):
|
||||||
|
|
||||||
if sort:
|
if sort:
|
||||||
objects.sort(cmp=comp_object)
|
objects.sort(cmp=comp_object)
|
||||||
|
collections = self._merge_collections_with_same_path(collections)
|
||||||
collections.sort(cmp=comp_object)
|
collections.sort(cmp=comp_object)
|
||||||
for collection in collections:
|
for collection in collections:
|
||||||
self._format_collection(collection, only)
|
self._format_collection(collection, only)
|
||||||
|
|
@ -1042,6 +1043,22 @@ class ReplApplication(Cmd, ConsoleApplication):
|
||||||
# Save collections only if we listed the current path.
|
# Save collections only if we listed the current path.
|
||||||
self.collections = collections
|
self.collections = collections
|
||||||
|
|
||||||
|
def _find_collection(self, collection, collections):
|
||||||
|
for col in collections:
|
||||||
|
if col.split_path == collection.split_path:
|
||||||
|
return col
|
||||||
|
return None
|
||||||
|
|
||||||
|
def _merge_collections_with_same_path(self, collections):
|
||||||
|
to_return = []
|
||||||
|
for collection in collections:
|
||||||
|
col = self._find_collection(collection, to_return)
|
||||||
|
if col:
|
||||||
|
col.backend += " %s" % collection.backend
|
||||||
|
else:
|
||||||
|
to_return.append(collection)
|
||||||
|
return to_return
|
||||||
|
|
||||||
|
|
||||||
def _format_collection(self, collection, only):
|
def _format_collection(self, collection, only):
|
||||||
if only is False or collection.basename in only:
|
if only is False or collection.basename in only:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue