Display renew confirmation/errors

This commit is contained in:
Florent Fourcot 2012-03-15 23:15:20 +01:00 committed by Romain Bignon
commit 65251c4ceb
5 changed files with 24 additions and 10 deletions

View file

@ -20,7 +20,7 @@
from weboob.capabilities.library import ICapBook, Book
from weboob.tools.application.repl import ReplApplication
from weboob.tools.application.formatters.iformatter import IFormatter
import sys
__all__ = ['Boobooks']
@ -78,4 +78,6 @@ class Boobooks(ReplApplication):
return 2
names = (backend_name,) if backend_name is not None else None
self.do('renew_book', id, backends=names)
for backend, renew in self.do('renew_book', id, backends=names):
self.format(renew)
self.flush()

View file

@ -35,6 +35,10 @@ class Book(CapBaseObject):
self.add_field('date', (datetime, date)) # which may be the due date
self.add_field('late', bool)
class Renew(CapBaseObject):
def __init__(self, id):
CapBaseObject.__init__(self, id)
self.add_field('message', basestring)
class ICapBook(ICapCollection):
def iter_resources(self, objs, split_path):