From a87517a0b385f1a68dd80e7dabf7843955c95ab9 Mon Sep 17 00:00:00 2001 From: Michaƫl Ball Date: Sun, 30 Jun 2019 11:12:05 +0100 Subject: Style fixes --- db/db_manager.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'db') diff --git a/db/db_manager.py b/db/db_manager.py index 9c2dd53..2684fb3 100644 --- a/db/db_manager.py +++ b/db/db_manager.py @@ -8,9 +8,9 @@ import sqlite3 import six - _LOGGER = logging.getLogger(__name__) + class DbManager(object): """DBManager makes interacting with sqlite databases easier.""" @@ -72,16 +72,17 @@ class DbManager(object): yield six.u("{0};").format(sql) table_name_ident = table_name.replace("\"", "\"\"") - res = cursor.execute("PRAGMA table_info(\"{0}\")".format( - table_name_ident)) + res = cursor.execute( + "PRAGMA table_info(\"{0}\")".format(table_name_ident)) column_names = [ - str(table_info[1]) for table_info in res.fetchall()] + str(table_info[1]) for table_info in res.fetchall() + ] query = """ SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}"; - """.format(table_name_ident, ",".join( - """'||quote("{0}")||'""".format( - col.replace( - "\"", "\"\"")) for col in column_names)) + """.format( + table_name_ident, ",".join( + """'||quote("{0}")||'""".format(col.replace("\"", "\"\"")) + for col in column_names)) query_res = cursor.execute(query) for row in query_res: yield six.u("{0};").format(row[0]) -- cgit v1.2.3