helper_search flake8 fixes
This commit is contained in:
parent
28cfe78e67
commit
9041b8f644
|
@ -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,12 +8,14 @@ try:
|
|||
except ImportError:
|
||||
haveQt = False
|
||||
|
||||
|
||||
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):
|
||||
if what is not None and what != "":
|
||||
what = "%" + what + "%"
|
||||
|
@ -67,6 +70,7 @@ 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):
|
||||
if what is not None and what != "":
|
||||
if where in (search_translate("MainWindow", "To"), search_translate("MainWindow", "All")):
|
||||
|
|
Loading…
Reference in New Issue
Block a user