Datenbank erstellt
Datenbank erstellt für die Kategorien und Webseiten database.py um die Datenbank zu erstellen
This commit is contained in:
parent
8fb8500744
commit
8bff182bfc
57
database.py
Normal file
57
database.py
Normal file
@ -0,0 +1,57 @@
|
||||
import sqlite3
|
||||
|
||||
# Verbindung zur Datenbank herstellen (eine neue Datenbank wird erstellt, wenn sie nicht vorhanden ist)
|
||||
connection = sqlite3.connect('webseiten.db')
|
||||
cursor = connection.cursor()
|
||||
|
||||
# Tabelle für Kategorien erstellen
|
||||
cursor.execute('''
|
||||
CREATE TABLE IF NOT EXISTS categories (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL
|
||||
)
|
||||
''')
|
||||
|
||||
# Tabelle für Webseiten erstellen
|
||||
cursor.execute('''
|
||||
CREATE TABLE IF NOT EXISTS webpages (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
category_id INTEGER,
|
||||
FOREIGN KEY (category_id) REFERENCES categories (id)
|
||||
)
|
||||
''')
|
||||
|
||||
# Kategorien hinzufügen
|
||||
categories = ["IT/Elektronik", "Baumarkt", "Schilder", "Verpackungen",
|
||||
"Küchenbedarf", "Reinigungs Artikel", "Büro Artikel",
|
||||
"Deko", "Landwirtschaft/Garten", "Arbeitsschutz", "Hygiene",
|
||||
"Etiketten/Papier", "Drogentest"]
|
||||
|
||||
for category in categories:
|
||||
cursor.execute("INSERT INTO categories (name) VALUES (?)", (category,))
|
||||
|
||||
# Webseiten hinzufügen
|
||||
webpages = [
|
||||
["Reichelt", "Kosatec", "Conrad"],
|
||||
["Hornbach", "Contorion","Gastroteile Shop", "TiroLED", "Megabad", "Baubeschlagshop", "IPS", "Häfele", "Delker", "Knauss"],
|
||||
["Brewes", "Schildershop24", "Skiltex", "VKF-Renzel"],
|
||||
["Papstar", "Pacovis", "Transpak", "TVV-Verpackungen", "Eierschachteln.de", "DM-Folien"],
|
||||
["Esmeyer", "Lusini", "Tischwelt", "Schafferer", "Gastronomie Kaufhaus", "Börner", "GGM-Gastro"],
|
||||
["Hygi", "Proficlean Shop", "Reinigungsberater", "Franz-Mensch"],
|
||||
["Böttcher", "Buchhandlung am Markt", "Büroshop24.de"],
|
||||
["Frank-Flechtwaren", "Betzold", "VBS-Hobby"],
|
||||
["Siepmann", "FK-Söhnchen", "Wahl-Agar", "KOX"],
|
||||
["Arbeitsplatzmatten Profi", "ARA"],
|
||||
["Rossmann"],
|
||||
["PML", "Label-Ident"],
|
||||
["Ökonomed"]
|
||||
]
|
||||
|
||||
for category_id, webpage_list in enumerate(webpages, start=1):
|
||||
for webpage in webpage_list:
|
||||
cursor.execute("INSERT INTO webpages (name, category_id) VALUES (?, ?)", (webpage, category_id))
|
||||
|
||||
# Änderungen speichern und Verbindung schließen
|
||||
connection.commit()
|
||||
connection.close()
|
440
einkauf_suche.py
440
einkauf_suche.py
@ -7,11 +7,13 @@ from selenium.webdriver.common.keys import Keys
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
import sqlite3
|
||||
|
||||
import sys
|
||||
import concurrent.futures
|
||||
|
||||
|
||||
|
||||
BLANK_PAGE_URL = ""
|
||||
|
||||
class SearchThread(QThread):
|
||||
@ -692,75 +694,41 @@ class SearchThread(QThread):
|
||||
self.driver.get(search_url)
|
||||
|
||||
|
||||
categories = ["IT/Elektronik", "Baumarkt","Schilder","Verpackungen",
|
||||
"Küchenbedarf","Reinigungs Artikel", "Büro Artikel",
|
||||
"Deko","Landwirtschaft/Garten","Arbeitsschutz","Hygiene",
|
||||
"Etiketten/Papier",
|
||||
"Drogentest"]
|
||||
webpages = [
|
||||
["Reichelt", "Kosatec", "Conrad"],
|
||||
["Hornbach",
|
||||
"Contorion",
|
||||
"IPS",
|
||||
"Gastroteile Shop",
|
||||
"TiroLED",
|
||||
"Megabad",
|
||||
"Baubeschlagshop",
|
||||
"Häfele",
|
||||
"Delker",
|
||||
"Knauss"],
|
||||
["Brewes",
|
||||
"Schildershop24",
|
||||
"Skiltex",
|
||||
"VKF-Renzel"],
|
||||
["Papstar",
|
||||
"Pacovis",
|
||||
"Transpak",
|
||||
"TVV-Verpackungen",
|
||||
"Eierschachteln.de",
|
||||
"DM-Folien"],
|
||||
["Esmeyer",
|
||||
"Lusini",
|
||||
"Tischwelt",
|
||||
"Schafferer",
|
||||
"Gastronomie Kaufhaus",
|
||||
"Börner",
|
||||
"GGM-Gastro"],
|
||||
["Hygi",
|
||||
"Franz-Mensch",
|
||||
"Proficlean Shop",
|
||||
"Reinigungsberater"],
|
||||
["Böttcher",
|
||||
"Büroshop24.de",
|
||||
"Buchhandlung am Markt"],
|
||||
["Frank-Flechtwaren",
|
||||
"Betzold",
|
||||
"VBS-Hobby"],
|
||||
["Siepmann",
|
||||
"FK-Söhnchen",
|
||||
"Wahl-Agar",
|
||||
"KOX"],
|
||||
["ARA",
|
||||
"Arbeitsplatzmatten Profi"],
|
||||
["Rossmann"],
|
||||
["PML",
|
||||
"Label-Ident"],
|
||||
["Ökonomed"]
|
||||
]
|
||||
|
||||
class WebseitenSucheApp(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.category_webpages_mapping = {category: webpages for category, webpages in zip(categories, webpages)}
|
||||
self.categories, self.webpages = self.get_categories_and_webpages()
|
||||
|
||||
self.checkbox_states = {webpage: False for category_webpages in webpages for webpage in category_webpages}
|
||||
self.checkbox_states = {webpage: False for category_webpages in self.webpages for webpage in category_webpages}
|
||||
|
||||
self.search_term = ""
|
||||
self.driver = None
|
||||
|
||||
self.init_ui()
|
||||
|
||||
def get_categories_and_webpages(self):
|
||||
|
||||
connection = sqlite3.connect('webseiten.db')
|
||||
cursor = connection.cursor()
|
||||
|
||||
cursor.execute("SELECT name FROM categories")
|
||||
categories = [row[0] for row in cursor.fetchall()]
|
||||
|
||||
webpages = []
|
||||
for category in categories:
|
||||
cursor.execute("SELECT name FROM webpages WHERE category_id = (SELECT id FROM categories WHERE name = ?)", (category,))
|
||||
webpages.append([row[0] for row in cursor.fetchall()])
|
||||
|
||||
# Verbindung schließen
|
||||
connection.close()
|
||||
|
||||
return categories, webpages
|
||||
|
||||
|
||||
# ...
|
||||
|
||||
def init_ui(self):
|
||||
self.setStyleSheet("background-color: black; color: white;")
|
||||
layout = QVBoxLayout()
|
||||
@ -768,283 +736,159 @@ class WebseitenSucheApp(QWidget):
|
||||
# Kategorien und Webseiten in zwei vertikalen Spalten
|
||||
grid_layout = QGridLayout()
|
||||
|
||||
grid_layout.setVerticalSpacing(5)
|
||||
|
||||
# ...
|
||||
|
||||
# Add category in the first grid#############################################################
|
||||
category = "Baumarkt"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 0, 0, 1, 2)
|
||||
num_columns = 2 # Anzahl der Spalten
|
||||
|
||||
# Add corresponding webpages in the first column
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
for idx, category in enumerate(self.categories):
|
||||
category_label = QLabel(category)
|
||||
|
||||
green_webpages = ["Hornbach", "Contorion", "Gastroteile Shop", "TiroLED", "Megabad", "Baubeschlagshop" ]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
# Webseiten für die aktuelle Kategorie
|
||||
connection = sqlite3.connect('webseiten.db')
|
||||
cursor = connection.cursor()
|
||||
|
||||
yellow_webpages = ["IPS","Delker", "Knauss", "Häfele"]
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
cursor.execute("SELECT name FROM webpages WHERE category_id = (SELECT id FROM categories WHERE name = ?)", (category,))
|
||||
category_webpages = [row[0] for row in cursor.fetchall()]
|
||||
|
||||
grid_layout.addWidget(checkbox, row + 1, 0, 1, 2)
|
||||
connection.close()
|
||||
|
||||
category = "Verpackungen"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 8, 0, 1, 2)
|
||||
num_webpages = len(category_webpages)
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
# Hier kannst du die Anzahl der Zeilen und die Position für jede Kategorie individuell festlegen
|
||||
num_rows_for_category = max(num_webpages, 1) # Mindestens eine Zeile
|
||||
|
||||
green_webpages = ["Papstar", "Pacovis", "Transpak","TVV-Verpackungen","Eierschachteln.de","DM-Folien"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
if category == "Baumarkt":
|
||||
row_position = 0 # Starte die Kategorie "Baumarkt" in der ersten Reihe
|
||||
elif category == "Schilder":
|
||||
row_position = 4
|
||||
elif category == "Hygiene":
|
||||
row_position = 9
|
||||
elif category == "Drogentest":
|
||||
row_position = 11
|
||||
elif category == "Büro Artikel":
|
||||
row_position = 13
|
||||
elif category == "Küchenbedarf":
|
||||
row_position = 17
|
||||
elif category == "Landwirtschaft/Garten":
|
||||
row_position = 25
|
||||
elif category == "Verpackungen":
|
||||
row_position = 11
|
||||
elif category == "Reinigungs Artikel":
|
||||
row_position = 18
|
||||
elif category == "Arbeitsschutz":
|
||||
row_position = 23
|
||||
elif category == "Deko":
|
||||
row_position = 26
|
||||
else:
|
||||
row_position = idx * (num_rows_for_category + 1) # 1 zusätzliche Zeile für die Kategorie
|
||||
col_position = idx % num_columns
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
grid_layout.addWidget(category_label, row_position, col_position * 2, 1, 2) # Col Position * 2, um den Abstand zu erhöhen
|
||||
|
||||
grid_layout.addWidget(checkbox, row + 9, 0, 1, 2)
|
||||
for row, webpage in enumerate(category_webpages):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
category = "Deko"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 15, 0, 1, 2)
|
||||
# Hier kannst du Anpassungen für jede Kategorie vornehmen
|
||||
if category == "IT/Elektronik":
|
||||
green_webpages = ["Reichelt", "Kosatec", "Conrad"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
green_webpages = ["Frank-Flechtwaren", "Betzold", "VBS-Hobby"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
if category == "Schilder":
|
||||
green_webpages = ["Brewes","Schildershop24","Skiltex","VKF-Renzel"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
if category == "Hygiene":
|
||||
green_webpages = ["Rossmann"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row + 16, 0, 1, 2)
|
||||
if category == "Drogentest":
|
||||
green_webpages = ["Ökonomed"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
if category == "Büro Artikel":
|
||||
green_webpages = ["Böttcher","Buchhandlung am Markt"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
category = "Landwirtschaft/Garten"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 19, 0, 1, 2)
|
||||
yellow_webpages = ["Büroshop24.de"]
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
if category == "Küchenbedarf":
|
||||
green_webpages = ["Esmeyer","Lusini","Tischwelt","Schafferer","Gastronomie Kaufhaus"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
green_webpages = ["Siepmann","FK-Söhnchen","Wahl-Agar","KOX"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
yellow_webpages = ["Börner","GGM-Gastro"]
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
if category == "Landwirtschaft/Garten":
|
||||
green_webpages = ["Siepmann","FK-Söhnchen","Wahl-Agar","KOX"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row + 20, 0, 1, 2)
|
||||
if category == "Baumarkt":
|
||||
green_webpages = ["Hornbach","Contorion","Gastroteile Shop","Megabad","Baubeschlagshop","TiroLED"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
category = "Arbeitsschutz"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 24, 0, 1, 2)
|
||||
yellow_webpages = ["Häfele","Delker","Knauss","IPS"]
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
if category == "Verpackungen":
|
||||
green_webpages = ["Papstar","Pacovis","Transpak","TVV-Verpackungen","Eierschachteln.de","DM-Folien"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
green_webpages = ["ARA","Arbeitsplatzmatten Profi"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
if category == "Reinigungs Artikel":
|
||||
green_webpages = ["Hygi","Proficlean Shop","Reinigungsberater","Franz-Mensch"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
if category == "Arbeitsschutz":
|
||||
yellow_webpages = ["ARA","Arbeitsplatzmatten Profi"]
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row + 25, 0, 1, 2)
|
||||
if category == "Deko":
|
||||
green_webpages = ["Frank-Flechtwaren","Betzold","VBS-Hobby"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
category = "Hygiene"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 27, 0, 1, 2)
|
||||
if category == "Etiketten/Papier":
|
||||
green_webpages = ["Label-Ident","PML"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
grid_layout.addWidget(checkbox, row + 1 + row_position, col_position * 2, 1, 2)
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["Rossmann"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row + 28, 0, 1, 2)
|
||||
|
||||
category = "Drogentest"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 29, 0, 1, 2)
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["Ökonomed"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row + 30, 0, 1, 2)
|
||||
|
||||
|
||||
# Add category in the second grid#############################################################
|
||||
category = "IT/Elektronik"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 0, 2, 1, 2)
|
||||
# Setze den Stretch-Faktor für die zusätzliche Zeile zwischen den Kategorien
|
||||
grid_layout.setRowStretch(row_position + num_rows_for_category, 0)
|
||||
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["Reichelt", "Kosatec" ]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = ["Conrad"]
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row+ 1, 2, 1, 2)
|
||||
|
||||
|
||||
category = "Schilder"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 4, 2, 1, 2)
|
||||
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["Brewes", "Schildershop24","Skiltex","VKF-Renzel"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row+ 5, 2, 1, 2)
|
||||
|
||||
category = "Küchenbedarf"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 9, 2, 1, 2)
|
||||
|
||||
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["Esmeyer", "Lusini", "Tischwelt", "Schafferer", "Gastronomie Kaufhaus","Börner","GGM-Gastro"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row+ 10, 2, 1, 2)
|
||||
|
||||
|
||||
category = "Reinigungs Artikel"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 17, 2, 1, 2)
|
||||
|
||||
# Add corresponding webpages in the second column
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["Proficlean Shop", "Hygi", "Reinigungsberater", "Franz-Mensch"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row+ 18, 2, 1, 2)
|
||||
|
||||
category = "Büro Artikel"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 22, 2, 1, 2)
|
||||
|
||||
# Add corresponding webpages in the second column
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["Böttcher", "Büroshop24.de", "Buchhandlung am Markt"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row+ 23, 2, 1, 2)
|
||||
|
||||
category = "Etiketten/Papier"
|
||||
category_label = QLabel(category)
|
||||
grid_layout.addWidget(category_label, 26, 2, 1, 2)
|
||||
|
||||
# Add corresponding webpages in the second column
|
||||
for row, webpage in enumerate(self.category_webpages_mapping[category]):
|
||||
checkbox = QCheckBox(webpage)
|
||||
checkbox.setChecked(self.checkbox_states[webpage])
|
||||
checkbox.stateChanged.connect(self.make_checkbox_callback(webpage))
|
||||
checkbox.setStyleSheet("color: white; border: 1px solid white;")
|
||||
|
||||
green_webpages = ["PML","Label-Ident"]
|
||||
if any(green_webpage in webpage for green_webpage in green_webpages):
|
||||
checkbox.setStyleSheet("color: green;")
|
||||
|
||||
yellow_webpages = []
|
||||
if any(yellow_webpage in webpage for yellow_webpage in yellow_webpages):
|
||||
checkbox.setStyleSheet("color: yellow;")
|
||||
|
||||
grid_layout.addWidget(checkbox, row+ 27, 2, 1, 2)
|
||||
|
||||
|
||||
##########################################################################################################################
|
||||
|
||||
layout.addLayout(grid_layout)
|
||||
self.setLayout(layout)
|
||||
|
||||
# Suchbegriff-Eingabe
|
||||
self.search_label = QLabel("Geben Sie den Suchbegriff ein:")
|
||||
|
BIN
webseiten.db
Normal file
BIN
webseiten.db
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user