From bdcc5db8bb7ef2f271e3bfe4ca16f1e472e0ca33 Mon Sep 17 00:00:00 2001 From: Florent Fourcot Date: Thu, 15 Mar 2012 22:34:34 +0100 Subject: [PATCH] Add "renew" in ICapBook and in boobooks --- weboob/applications/boobooks/boobooks.py | 15 +++++++++++++++ weboob/capabilities/library.py | 3 +++ 2 files changed, 18 insertions(+) diff --git a/weboob/applications/boobooks/boobooks.py b/weboob/applications/boobooks/boobooks.py index 0a44ed77..b28e895c 100644 --- a/weboob/applications/boobooks/boobooks.py +++ b/weboob/applications/boobooks/boobooks.py @@ -64,3 +64,18 @@ class Boobooks(ReplApplication): } COLLECTION_OBJECTS = (Book, ) + + def do_renew(self, id): + """ + renew ID + + Renew a book + """ + + id, backend_name = self.parse_id(id) + if not id: + print >>sys.stderr, 'Error: please give a book ID (hint: use ls command)' + return 2 + names = (backend_name,) if backend_name is not None else None + + self.do('renew_book', id, backends=names) diff --git a/weboob/capabilities/library.py b/weboob/capabilities/library.py index 21cf3ace..2f1b1ed7 100644 --- a/weboob/capabilities/library.py +++ b/weboob/capabilities/library.py @@ -52,6 +52,9 @@ class ICapBook(ICapCollection): def get_booked(self, _id): raise NotImplementedError() + def renew_book(self, _id): + raise NotImplementedError() + def get_rented(self, _id): raise NotImplementedError()