Esempio n. 1
0
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']))
Esempio n. 2
0
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,
    )
Esempio n. 3
0
def books():
    userlist = Globals.Settings.UserList.users
    books = actions.ListBooks(userlist, False, None)
    return render_template('books.j2', books=books)
Esempio n. 4
0
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)