Add "renew" in ICapBook and in boobooks

This commit is contained in:
Florent Fourcot 2012-03-15 22:34:34 +01:00 committed by Romain Bignon
commit bdcc5db8bb
2 changed files with 18 additions and 0 deletions

View file

@ -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)

View file

@ -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()