From 49f9d629f3e8cadeb654d2da971e0cb97c4d092b Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 17 Apr 2017 00:08:20 +0100 Subject: rearrange the code a bit...it will be more easy to populate the tables --- everything.py | 25 +++++++++++------------ games.py | 42 ++++++++++++++++++++++++-------------- internet.py | 65 +++++++++++++++++++++++++++++++++++++++++++++-------------- office.py | 49 ++++++++++++++++++++++++++++++-------------- 4 files changed, 123 insertions(+), 58 deletions(-) diff --git a/everything.py b/everything.py index 797d579..2137525 100755 --- a/everything.py +++ b/everything.py @@ -37,19 +37,18 @@ class Everything(QtWidgets.QMainWindow): def load_packages(self): with sqlite3.connect('/var/lib/epkg/db/epkg.db') as db: cursor=db.cursor() - cursor.execute(''' - SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - FROM remote_packages AS a - LEFT JOIN local_packages AS i - ON a.category = i.category - AND a.name = i.name - AND a.slot = i.slot - ''') + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + ''') rows = cursor.fetchall() for row in rows: diff --git a/games.py b/games.py index 9b24c3e..05e02b0 100755 --- a/games.py +++ b/games.py @@ -37,21 +37,33 @@ class Games(QtWidgets.QMainWindow): def load_packages(self): with sqlite3.connect('/var/lib/epkg/db/epkg.db') as db: cursor=db.cursor() - cursor.execute(''' - SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - FROM remote_packages AS a - LEFT JOIN local_packages AS i - ON a.category = i.category - AND a.name = i.name - AND a.slot = i.slot - WHERE a.name IN - ('steam', 'playonlinux', 'armagetronad', 'chromium-bsu', 'supertuxkart', 'teeworlds', 'dosbox', 'snes9x', 'zsnes', 'urbanterror', 'openttd', '0ad', 'warzone2100', 'wesnoth') - ''') + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + WHERE a.name IN + ('steam', + 'playonlinux', + 'armagetronad', + 'chromium-bsu', + 'supertuxkart', + 'teeworlds', + 'dosbox', + 'snes9x', + 'zsnes', + 'urbanterror', + 'openttd', + '0ad', + 'warzone2100', + 'wesnoth') + ''') rows = cursor.fetchall() for row in rows: diff --git a/internet.py b/internet.py index fcfc219..57ecb29 100755 --- a/internet.py +++ b/internet.py @@ -37,21 +37,56 @@ class Internet(QtWidgets.QMainWindow): def load_packages(self): with sqlite3.connect('/var/lib/epkg/db/epkg.db') as db: cursor=db.cursor() - cursor.execute(''' - SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - FROM remote_packages AS a - LEFT JOIN local_packages AS i - ON a.category = i.category - AND a.name = i.name - AND a.slot = i.slot - WHERE a.name IN - ('firewalld', 'ufw', 'ufw-frontends', 'filezilla', 'franz', 'qtox', 'telegram', 'viber', 'konversation', 'quassel', 'dropbox', 'megasync', 'owncloud-client', 'teamviewer', 'tigervnc', 'youtube-dl', 'quiterss', 'qbittorrent', 'qbittorrent', 'transmission', 'firefox', 'google-chrome', 'opera', 'qupzilla', 'vivaldi', 'adobe-flash', 'chrome-binary-plugins', 'freshplayerplugin', 'google-talkplugin', 'wmail', 'trojita') - ''') + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + WHERE a.name IN + ('firewalld', + 'ufw', + 'ufw-frontends', + 'cifs-utils', + 'samba', + 'sshfs', + 'filezilla', + 'franz', + 'qtox', + 'telegram', + 'viber', + 'konversation', + 'quassel', + 'aria2', + 'dropbox', + 'megasync', + 'owncloud-client', + 'teamviewer', + 'telnet-bsd', + 'tigervnc', + 'youtube-dl', + 'quiterss', + 'qbittorrent', + 'transmission', + 'firefox', + 'google-chrome', + 'opera', + 'qupzilla', + 'vivaldi', + 'adobe-flash', + 'chrome-binary-plugins', + 'freshplayerplugin', + 'google-talkplugin', + 'wmail', + 'trojita', + 'aircrack-ng', + 'wavemon') + ''') rows = cursor.fetchall() for row in rows: diff --git a/office.py b/office.py index 068b01e..819d264 100755 --- a/office.py +++ b/office.py @@ -37,21 +37,40 @@ class Office(QtWidgets.QMainWindow): def load_packages(self): with sqlite3.connect('/var/lib/epkg/db/epkg.db') as db: cursor=db.cursor() - cursor.execute(''' - SELECT - a.category AS cat, - a.name AS pn, - a.version AS av, - i.version AS iv, - a.description AS descr - FROM remote_packages AS a - LEFT JOIN local_packages AS i - ON a.category = i.category - AND a.name = i.name - AND a.slot = i.slot - WHERE a.name IN - ('fet', 'libreoffice', 'wps-office', 'tesseract', 'cantarell', 'corefonts', 'dejavu', 'liberation-fonts', 'libertine', 'noto', 'open-sans', 'roboto', 'ttf-bitstream-vera', 'qpdfview', 'cups', 'cups-filters', 'cups-pdf', 'simple-scan', 'cnijfilter', 'cnijfilter-drivers', 'hplip') - ''') + cursor.execute('''SELECT + a.category AS cat, + a.name AS pn, + a.version AS av, + i.version AS iv, + a.description AS descr + FROM remote_packages AS a + LEFT JOIN local_packages AS i + ON a.category = i.category + AND a.name = i.name + AND a.slot = i.slot + WHERE a.name IN + ('fet', + 'libreoffice', + 'wps-office', + 'tesseract', + 'cantarell', + 'corefonts', + 'dejavu', + 'liberation-fonts', + 'libertine', + 'noto', + 'open-sans', + 'roboto', + 'ttf-bitstream-vera', + 'qpdfview', + 'cups', + 'cups-filters', + 'cups-pdf', + 'simple-scan', + 'cnijfilter', + 'cnijfilter-drivers', + 'hplip') + ''') rows = cursor.fetchall() for row in rows: -- cgit v1.2.3