def list(ctx, user, read): userlist = Globals.Settings.UserList.users if user: userlist = [Globals.Settings.UserList.getUser(user)] books = actions.ListBooks(userlist, read) headers = ['Title', 'Author', 'RevisionId', 'Archived', 'Owner'] data = sorted([(book.Title, book.Author, book.RevisionId, book.Archived, book.Owner.Email) for book in books]) click.echo(tabulate(data, headers, tablefmt=ctx['fmt']))
def getUserBooks(userid, error=None, success=None): user = Globals.Settings.UserList.getUser(userid) if not user: abort(404) books = actions.ListBooks([user], False, None) calibre = Globals.Settings.UserList.calibre_web return render_template( 'books.j2', books=books, calibre=calibre, error=error, success=success, )
def books(): userlist = Globals.Settings.UserList.users books = actions.ListBooks(userlist, False, None) return render_template('books.j2', books=books)
def getUserBooks(userid): user = Globals.Settings.UserList.getUser(userid) if not user: abort(404) books = actions.ListBooks([user], False, None) return render_template('books.j2', books=books)