[repl] Optimization: do not fetch the collections when not needed

This commit is contained in:
Bezleputh 2014-01-20 20:28:18 +01:00 committed by Florent
commit c6a9abcc7e

View file

@ -1067,12 +1067,13 @@ class ReplApplication(Cmd, ConsoleApplication):
# update the path from the collection if possible # update the path from the collection if possible
if len(collections) == 1: if len(collections) == 1:
self.working_path.split_path = collections[0].split_path self.working_path.split_path = collections[0].split_path
self._change_prompt()
else: else:
print >>sys.stderr, u"Path: %s not found" % unicode(self.working_path) print >>sys.stderr, u"Path: %s not found" % unicode(self.working_path)
self.working_path.restore() self.working_path.restore()
return 1 return 1
self._change_prompt()
def _fetch_objects(self, objs): def _fetch_objects(self, objs):
objects = [] objects = []
collections = [] collections = []