Use shortcut of id in interactive mode. Closes #881

This commit is contained in:
Florent 2014-09-02 15:41:18 +02:00
commit c8e568fdd0

View file

@ -190,7 +190,11 @@ class ReplApplication(Cmd, ConsoleApplication):
try:
obj = self.objects[int(id) - 1]
except (IndexError, ValueError):
pass
# Try to find a shortcut in the cache
for obj in self.objects:
if id in obj.id:
id = obj.fullid
break
else:
if isinstance(obj, BaseObject):
id = obj.fullid