summaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorbionel <ionel.busuioc@gmail.com>2017-09-23 21:11:11 +0300
committerbionel <ionel.busuioc@gmail.com>2017-09-23 21:11:11 +0300
commit3534bd6f81c1bd371344106e67c7ef0668afdf1e (patch)
tree7548c3f9abb56dc238af907c2d7ecc2328825136 /src/frontend
parentfcf30e3096930f6428847b35cb9efe340b846c7d (diff)
a bit of code cleanup
Diffstat (limited to 'src/frontend')
-rwxr-xr-xsrc/frontend/gui/sisyphus-gui.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 6f916e2..e0b112a 100755
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -87,13 +87,13 @@ class Sisyphus(QtWidgets.QMainWindow):
def setSearchField(self):
Sisyphus.SEARCHFIELD = self.SEARCHFIELDS[self.selectfield.currentText()]
- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
+ self.loadDatabase()
def setSearchFilter(self):
Sisyphus.SEARCHFILTER = self.SEARCHFILTERS[self.selectfilter.currentText()]
- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
+ self.loadDatabase()
- def loadDatabase(self,searchField,searchTerm,searchFilter):
+ def loadDatabase(self):
with sqlite3.connect('/var/lib/sisyphus/db/sisyphus.db') as db:
cursor=db.cursor()
cursor.execute('''SELECT
@@ -108,7 +108,7 @@ class Sisyphus(QtWidgets.QMainWindow):
AND a.name = i.name
AND a.slot = i.slot
WHERE %s LIKE %s %s
- ''' % (searchField, searchTerm, searchFilter))
+ ''' % (Sisyphus.SEARCHFIELD, Sisyphus.SEARCHTERM, Sisyphus.SEARCHFILTER))
rows = cursor.fetchall()
Sisyphus.PKGCOUNT = len(rows)
Sisyphus.PKGSELECTED = 0
@@ -125,10 +125,10 @@ class Sisyphus(QtWidgets.QMainWindow):
def filterDatabase(self):
search = self.input.text()
Sisyphus.SEARCHTERM = "'%" + search + "%'"
- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
+ self.loadDatabase()
def updateSystem(self):
- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
+ self.loadDatabase()
self.updateThread.start()
def packageInstall(self):
@@ -159,7 +159,7 @@ class Sisyphus(QtWidgets.QMainWindow):
def jobDone(self):
self.hideProgressBar()
- self.loadDatabase(Sisyphus.SEARCHFIELD,Sisyphus.SEARCHTERM,Sisyphus.SEARCHFILTER)
+ self.loadDatabase()
def showProgressBar(self):
self.hideButtons()