diff --git a/.idea/Final.iml b/.idea/Final.iml index 94375e8..980109b 100644 --- a/.idea/Final.iml +++ b/.idea/Final.iml @@ -2,9 +2,10 @@ + - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 4b189dd..9141669 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/app/__pycache__/ConfigMgr.cpython-313.pyc b/app/__pycache__/ConfigMgr.cpython-313.pyc index e282995..630b1de 100644 Binary files a/app/__pycache__/ConfigMgr.cpython-313.pyc and b/app/__pycache__/ConfigMgr.cpython-313.pyc differ diff --git a/app/__pycache__/__init__.cpython-313.pyc b/app/__pycache__/__init__.cpython-313.pyc index 8c9fe6f..8af1d04 100644 Binary files a/app/__pycache__/__init__.cpython-313.pyc and b/app/__pycache__/__init__.cpython-313.pyc differ diff --git a/app/chat_server/__pycache__/Server.cpython-313.pyc b/app/chat_server/__pycache__/Server.cpython-313.pyc index 0f7935a..5ac42c6 100644 Binary files a/app/chat_server/__pycache__/Server.cpython-313.pyc and b/app/chat_server/__pycache__/Server.cpython-313.pyc differ diff --git a/app/chat_server/__pycache__/__init__.cpython-313.pyc b/app/chat_server/__pycache__/__init__.cpython-313.pyc index 20e5ff2..fa693bf 100644 Binary files a/app/chat_server/__pycache__/__init__.cpython-313.pyc and b/app/chat_server/__pycache__/__init__.cpython-313.pyc differ diff --git a/app/main.py b/app/main.py index fa38148..277fa54 100644 --- a/app/main.py +++ b/app/main.py @@ -152,7 +152,7 @@ frame_right.rowconfigure(0, weight=3) frame_right.rowconfigure(1, weight=1) frame_right.columnconfigure(0, weight=1) -# Create and place the chat frame and music player tab +# Create and place the chat frame and music player tab update chat_frame = ChatTab(frame_chat, chat_server_url=config_manager.config["Chat"]["server"], sender_name=config_manager.config["Chat"]["name"], stop_event=stop_event, width=200, bg="lightgreen", refresh_rate=1) diff --git a/app/widgets/WebScrapingTab.py b/app/widgets/WebScrapingTab.py index 9ad9c8b..bb57a7c 100644 --- a/app/widgets/WebScrapingTab.py +++ b/app/widgets/WebScrapingTab.py @@ -33,25 +33,43 @@ class WebScrapingTab(ThreadedTab): self.data_listbox.pack(pady=10) def create_database(self): - # Connect to MySQL database - conn = mysql.connector.connect( - host="127.0.0.1 ", - user="santipy", - password="1234", - database="scraping_db" - ) - cursor = conn.cursor() + try: + # Conectar sin especificar la base de datos + conn = mysql.connector.connect( + host="127.0.0.1", + user="santipy", + password="1234" + ) + cursor = conn.cursor() - # Crear la tabla si no existe - cursor.execute(""" - CREATE TABLE IF NOT EXISTS scraped_data ( - id INT AUTO_INCREMENT PRIMARY KEY, - title VARCHAR(255), - link TEXT - ) - """) - conn.commit() - return conn + # Crear la base de datos si no existe + cursor.execute("CREATE DATABASE IF NOT EXISTS scraping_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci") + conn.commit() + + # Conectar a la base de datos + conn = mysql.connector.connect( + host="127.0.0.1", + user="santipy", + password="1234", + database="scraping_db" + ) + + # Crear la tabla si no existe + cursor = conn.cursor() + cursor.execute(""" + CREATE TABLE IF NOT EXISTS scraped_data ( + id INT AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255), + link TEXT + ) + """) + conn.commit() + + return conn + except mysql.connector.Error as err: + print(f"Error al conectar o crear la base de datos: {err}") + messagebox.showerror("Database Error", f"Error al conectar o crear la base de datos: {err}") + return None def save_to_database(self): diff --git a/app/widgets/__pycache__/ChatTab.cpython-313.pyc b/app/widgets/__pycache__/ChatTab.cpython-313.pyc index 0f6ada6..a592fed 100644 Binary files a/app/widgets/__pycache__/ChatTab.cpython-313.pyc and b/app/widgets/__pycache__/ChatTab.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/ClockLabel.cpython-313.pyc b/app/widgets/__pycache__/ClockLabel.cpython-313.pyc index 599e940..e75fc42 100644 Binary files a/app/widgets/__pycache__/ClockLabel.cpython-313.pyc and b/app/widgets/__pycache__/ClockLabel.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/MusicDownloadTab.cpython-313.pyc b/app/widgets/__pycache__/MusicDownloadTab.cpython-313.pyc index 9f8ea8a..b1d442e 100644 Binary files a/app/widgets/__pycache__/MusicDownloadTab.cpython-313.pyc and b/app/widgets/__pycache__/MusicDownloadTab.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/MusicPlayerTab.cpython-313.pyc b/app/widgets/__pycache__/MusicPlayerTab.cpython-313.pyc index c1acc1d..834d9f1 100644 Binary files a/app/widgets/__pycache__/MusicPlayerTab.cpython-313.pyc and b/app/widgets/__pycache__/MusicPlayerTab.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/TicTacToeTab.cpython-313.pyc b/app/widgets/__pycache__/TicTacToeTab.cpython-313.pyc index 9c9fb43..76d207e 100644 Binary files a/app/widgets/__pycache__/TicTacToeTab.cpython-313.pyc and b/app/widgets/__pycache__/TicTacToeTab.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/TodoTab.cpython-313.pyc b/app/widgets/__pycache__/TodoTab.cpython-313.pyc index 3313ee3..4c39b86 100644 Binary files a/app/widgets/__pycache__/TodoTab.cpython-313.pyc and b/app/widgets/__pycache__/TodoTab.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/UsageLabels.cpython-313.pyc b/app/widgets/__pycache__/UsageLabels.cpython-313.pyc index 9f9f7a1..64b653d 100644 Binary files a/app/widgets/__pycache__/UsageLabels.cpython-313.pyc and b/app/widgets/__pycache__/UsageLabels.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/WeatherTab.cpython-313.pyc b/app/widgets/__pycache__/WeatherTab.cpython-313.pyc index 5a3ea41..0164f61 100644 Binary files a/app/widgets/__pycache__/WeatherTab.cpython-313.pyc and b/app/widgets/__pycache__/WeatherTab.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/WebScrapingTab.cpython-313.pyc b/app/widgets/__pycache__/WebScrapingTab.cpython-313.pyc index 1f0acfe..9595fe8 100644 Binary files a/app/widgets/__pycache__/WebScrapingTab.cpython-313.pyc and b/app/widgets/__pycache__/WebScrapingTab.cpython-313.pyc differ diff --git a/app/widgets/__pycache__/__init__.cpython-313.pyc b/app/widgets/__pycache__/__init__.cpython-313.pyc index a95a39b..b8d5c47 100644 Binary files a/app/widgets/__pycache__/__init__.cpython-313.pyc and b/app/widgets/__pycache__/__init__.cpython-313.pyc differ diff --git a/app/widgets/abc/__pycache__/ThreadedLabel.cpython-313.pyc b/app/widgets/abc/__pycache__/ThreadedLabel.cpython-313.pyc index bba0f3c..d92565e 100644 Binary files a/app/widgets/abc/__pycache__/ThreadedLabel.cpython-313.pyc and b/app/widgets/abc/__pycache__/ThreadedLabel.cpython-313.pyc differ diff --git a/app/widgets/abc/__pycache__/ThreadedTab.cpython-313.pyc b/app/widgets/abc/__pycache__/ThreadedTab.cpython-313.pyc index 9bf6c48..a1a8178 100644 Binary files a/app/widgets/abc/__pycache__/ThreadedTab.cpython-313.pyc and b/app/widgets/abc/__pycache__/ThreadedTab.cpython-313.pyc differ diff --git a/app/widgets/abc/__pycache__/__init__.cpython-313.pyc b/app/widgets/abc/__pycache__/__init__.cpython-313.pyc index 8fd9c27..519bc66 100644 Binary files a/app/widgets/abc/__pycache__/__init__.cpython-313.pyc and b/app/widgets/abc/__pycache__/__init__.cpython-313.pyc differ