From 67b4e6ce8e18f04ec0c4a922cd72028129a4d285 Mon Sep 17 00:00:00 2001 From: Mahendra Garg Date: Tue, 10 Apr 2018 15:03:17 +0530 Subject: [PATCH] Removed unneccesory imports and removed search_translate function from helper_search file --- src/helper_search.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/helper_search.py b/src/helper_search.py index b3d4f923..52a26175 100644 --- a/src/helper_search.py +++ b/src/helper_search.py @@ -1,6 +1,9 @@ -#!/usr/bin/python2.7 +"""Helper search is is used to perform search operation from sql.""" -from helper_sql import * +# !/usr/bin/python2.7 + +from helper_sql import sqlQuery +from tr import _translate as search_translate try: from PyQt4 import QtGui @@ -8,13 +11,8 @@ try: except Exception: 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): +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"): @@ -68,7 +66,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():