From c8e568fdd0e8864dbb76ac93db8c002b42b874be Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 2 Sep 2014 15:41:18 +0200 Subject: [PATCH] Use shortcut of id in interactive mode. Closes #881 --- weboob/tools/application/repl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py index 9f4cac0b..d765e15a 100644 --- a/weboob/tools/application/repl.py +++ b/weboob/tools/application/repl.py @@ -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