PK!Vu00hello_todo/.cli.py.swpb0VIM 8.0f[j&xZmathiasGration~mathias/workspace/hello_todo/hello_todo/cli.pyutf-8 3210#"! Utpadv ² click.echo("coucou")def hello():@click.command()import .db as dbimport clickPK!e00hello_todo/.db.py.swpb0VIM 8.09e[%xZmathiasGration~mathias/workspace/hello_todo/hello_todo/db.py 3210#"! Utp4ad 4;\.-, ` _ ^  | ] U T E  l k j N : + s Z Y conn.execute("UPD conn.execute conn.ex conn.execute("UPDATE todo SET return results results = conn.execute("SELECT * FROM todo where todolist_id = ?", (todolist_id,)) with conn: conn = get_db()def get_todos(todolist_id): return results results = conn.execute("SELECT * FROM todolist") with conn: conn = get_db()def get_all_todolist(): conn.execute(query, (name, description, deadline, status, todolist_id)) with conn: """ values (?, ?, ?, ?, ?) INSERT INTO todo (name, description, deadline, status, todolist_id) query = """ conn = get_db() """ add a todo to a todolist """def add_todo(name, todolist_id, description=None, deadline=None, status=0): conn.execute("INSERT INTO todolist (name, description) values (?, ?)", (name, description)) with conn: conn = get_db() """ add a todolist """def add_todolist(name, description=None): conn.executescript(query.decode("utf-8")) query = pkg_resources.resource_string(__name__, "init_db.sql") conn = get_db() """ initialize database """def init_db(): return conn conn.row_factory = sqlite3.Row conn = sqlite3.connect(db_path) db_path = db_path or os.path.join(os.environ["HOME"], ".todolist.db") """ returns a connection to the database """def get_db(db_path=None):import pkg_resourcesimport osimport sqlite3PK!`00hello_todo/.init_db.sql.swpb0VIM 8.0c[%xZmathiasGration~mathias/workspace/hello_todo/hello_todo/init_db.sqlutf-8 3210#"! Utpad /[>;:'i2/); FOREIGN KEY (todolist_id) REFERENCES todolist (id) todolist_id INTEGER NOT NULL, status INTEGER, deadline VARCHAR(23), description VARCHAR(150), name VARCHAR(50) UNIQUE NOT NULL, id INTEGER PRIMARY KEY AUTOINCREMENT,CREATE TABLE todo(); description VARCHAR(150) name VARCHAR(50) UNIQUE NOT NULL, id INTEGER PRIMARY KEY AUTOINCREMENT,CREATE TABLE todolist (DROP TABLE IF EXISTS todo ;DROP TABLE IF EXISTS todolist ;PK! qhello_todo/__init__.py__version__ = '0.1.0' PK!3BcVVhello_todo/cli.pyimport click import .db as db @click.command() def hello(): click.echo("coucou") PK!yDDhello_todo/db.pyimport sqlite3 import os import pkg_resources def get_db(db_path=None): """ returns a connection to the database """ db_path = db_path or os.path.join(os.environ["HOME"], ".todolist.db") conn = sqlite3.connect(db_path) conn.row_factory = sqlite3.Row return conn def init_db(): """ initialize database """ conn = get_db() query = pkg_resources.resource_string(__name__, "init_db.sql") conn.executescript(query.decode("utf-8")) def add_todolist(name, description=None): """ add a todolist """ conn = get_db() with conn: conn.execute("INSERT INTO todolist (name, description) values (?, ?)", (name, description)) def add_todo(name, todolist_id, description=None, deadline=None, status=0): """ add a todo to a todolist """ conn = get_db() query = """ INSERT INTO todo (name, description, deadline, status, todolist_id) values (?, ?, ?, ?, ?) """ with conn: conn.execute(query, (name, description, deadline, status, todolist_id)) def get_all_todolist(): conn = get_db() with conn: results = conn.execute("SELECT * FROM todolist") return results def get_todos(todolist_id): conn = get_db() with conn: results = conn.execute("SELECT * FROM todo where todolist_id = ?", (todolist_id,)) return results PK!u2hello_todo/init_db.sqlDROP TABLE IF EXISTS todolist ; DROP TABLE IF EXISTS todo ; CREATE TABLE todolist ( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(50) UNIQUE NOT NULL, description VARCHAR(150) ); CREATE TABLE todo( id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(50) UNIQUE NOT NULL, description VARCHAR(150), deadline VARCHAR(23), status INTEGER, todolist_id INTEGER NOT NULL, FOREIGN KEY (todolist_id) REFERENCES todolist (id) ); PK!H.dz*.+hello_todo-0.1.1.dist-info/entry_points.txtN+I/N.,()*O/Hɏs2\..PK!H WX hello_todo-0.1.1.dist-info/WHEEL A н#Z."jm)Afb~ڠO68oF04UhoAf f4=4h0k::wXPK!HO3#hello_todo-0.1.1.dist-info/METADATAN1 E /A"Ѵ<E`DPtmMM&"!,dT>;{ cAA);j! 0, YZm Ax@mg3b~*#' , y Ѳ H ăǜݧ& CpGЕ8O־־h6.f[\,]./8UwVݩPK!Hڎ@ X!hello_todo-0.1.1.dist-info/RECORD}r@} eI&ɦAVnQennOv.:_IʹƆ貈VjY4[ܶ{sjHwFt[MP4/ٓp|;$U^5Yz)*  UupB>^>:ɥF#FPq\omDYUBǢy+"~KdI:,\CWKf Z6d#=K 0|kc EEƨ)~ *5"APK!Vu00hello_todo/.cli.py.swpPK!e0040hello_todo/.db.py.swpPK!`00g`hello_todo/.init_db.sql.swpPK! qhello_todo/__init__.pyPK!3BcVVhello_todo/cli.pyPK!yDDohello_todo/db.pyPK!u2hello_todo/init_db.sqlPK!H.dz*.+hello_todo-0.1.1.dist-info/entry_points.txtPK!H WX Yhello_todo-0.1.1.dist-info/WHEELPK!HO3#hello_todo-0.1.1.dist-info/METADATAPK!Hڎ@ X!hello_todo-0.1.1.dist-info/RECORDPK G