longbox

comic book stash manager
git clone git://git.pyratebeard.net/longbox.git
Log | Files | Refs | README

commit 232b70285e97f5a048eae34f3c8f555ab4d5453b
parent cac57944d6dbe84601066b79ba0f0cfd98d1f2cd
Author: pyratebeard <root@pyratebeard.net>
Date:   Thu, 28 Jul 2022 14:38:35 +0100

prettytable output

Diffstat:
Mlongbox | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/longbox b/longbox @@ -14,10 +14,14 @@ # * easy view stash # * web browser # * ranger style ncurses +# * import from csv +# * search stash +# * organise from getpass import getpass from mysql.connector import connect, Error import argparse +from prettytable import PrettyTable # parse arguments parser = argparse.ArgumentParser(description = "comic book stash manager") @@ -41,6 +45,10 @@ AND gcd_issue.series_id = gcd_series.id AND gcd_issue.publication_date LIKE CONCAT('%', %s) """ +x = PrettyTable() +x.field_names = ['id','series','issue','variant','date','barcode'] +x.align = "l" + try: with connect( host="localhost", @@ -51,7 +59,8 @@ try: with connection.cursor() as cursor: cursor.execute(search_terms, (search_series, search_number, search_date,)) for issue in cursor.fetchall(): - print(issue) + x.add_row(issue) + print(x) except Error as e: print(e)