From 9041b8f64431c4047992e0699dba1be80a7f762f Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Wed, 9 Oct 2019 16:30:12 +0530 Subject: [PATCH] helper_search flake8 fixes --- src/helper_search.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/helper_search.py b/src/helper_search.py index 0908ada3..8dfc7eb6 100644 --- a/src/helper_search.py +++ b/src/helper_search.py @@ -1,5 +1,6 @@ """Additional SQL helper for searching messages""" -from helper_sql import * + +from helper_sql import sqlQuery try: from PyQt4 import QtGui @@ -7,13 +8,15 @@ try: except ImportError: haveQt = False -def search_translate (context, text): + +def search_translate(context, text): if haveQt: return QtGui.QApplication.translate(context, text) else: return text.lower() -def search_sql(xAddress = "toaddress", account = None, folder = "inbox", where = None, what = None, unreadOnly = False): + +def search_sql(xAddress="toaddress", account=None, folder="inbox", where=None, what=None, unreadOnly=False): if what is not None and what != "": what = "%" + what + "%" if where == search_translate("MainWindow", "To"): @@ -31,7 +34,7 @@ def search_sql(xAddress = "toaddress", account = None, folder = "inbox", where = if folder == "sent": sqlStatementBase = ''' - SELECT toaddress, fromaddress, subject, status, ackdata, lastactiontime + SELECT toaddress, fromaddress, subject, status, ackdata, lastactiontime FROM sent ''' else: sqlStatementBase = '''SELECT folder, msgid, toaddress, fromaddress, subject, received, read @@ -67,7 +70,8 @@ def search_sql(xAddress = "toaddress", account = None, folder = "inbox", where = sqlStatementBase += " ORDER BY lastactiontime" return sqlQuery(sqlStatementBase, sqlArguments) -def check_match(toAddress, fromAddress, subject, message, where = None, what = None): + +def check_match(toAddress, fromAddress, subject, message, where=None, what=None): if what is not None and what != "": if where in (search_translate("MainWindow", "To"), search_translate("MainWindow", "All")): if what.lower() not in toAddress.lower():