Clean lint problems

This commit is contained in:
2018-07-21 15:55:07 +02:00
parent b18c4dcd18
commit f426b616fd
8 changed files with 30 additions and 47 deletions

View File

@@ -1,7 +1,4 @@
# import sqlite3
import os
import argparse
import json
import getpass
import datetime
import logging
@@ -28,7 +25,7 @@ class Project:
def handle_project(args, last_action, conn):
logging.info("> handle project")
logging.debug("args: " + str(args))
logging.debug("args: %s", args)
if not args:
list_project(last_action.project_id, conn)
@@ -58,10 +55,9 @@ def handle_project(args, last_action, conn):
else:
project_id = last_action.project_id
parse_project_args(project, args[1:])
logging.debug("Project: ({}) {}".format(project_id, project))
logging.debug("Project: (%s) %s", project_id, project)
edit_project(project, project_id, conn)
# TODO To set as active project, us a -a option?
elif args[0] == "-d":
if len(args) > 1:
@@ -133,11 +129,11 @@ def edit_project(project, project_id, conn):
)
sys.exit(1)
logging.debug("Project update args: {}".format(update_args))
logging.debug("Project update args: %s", update_args)
query = "UPDATE project SET {} WHERE id = ?"
query = query.format(", ".join("%s = '%s'" % (k, v) for k, v in update_args))
logging.debug("update project query: " + query)
logging.debug("update project query: %s", query)
cursor = conn.cursor()
logging.debug("Do a project update")
@@ -179,7 +175,7 @@ def list_project(active_project_id, conn):
cursor = conn.cursor()
cursor.execute(query)
for row in cursor.fetchall():
logging.debug("Project row: {}".format(row))
logging.debug("Project row: %s", row)
project_id, username, name, status, nb_task = row
# TODO Formatting track: https://stackoverflow.com/questions/9989334/create-nice-column-output-in-python
print(
@@ -219,7 +215,7 @@ def view_project_set_active(project_id, last_action, conn):
"""
cursor.execute(query, (project_id,))
for row in cursor.fetchall():
logging.debug("Task row: {}".format(row))
logging.debug("Task row: %s", row)
task_id, username, name, status, priority, date, time, nb_note = row
message = date + time + name
print(