From 1f9ec59e64c03f9f618f823ae3422c206a70b6ab Mon Sep 17 00:00:00 2001 From: DennisEckerskorn Date: Wed, 8 Jan 2025 21:57:18 +0100 Subject: [PATCH] Updated imports cassue moved project to PyCharm, and started EmailClient class --- .idea/.gitignore | 3 ++ .idea/MutiFunctionProgramProject.iml | 12 +++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ .idea/misc.xml | 7 ++++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ src/main.py | 2 +- src/services/EmailClient.py | 30 ++++++++++++++++++ src/services/Radio_Player.py | 2 +- .../__pycache__/Radio_Player.cpython-312.pyc | Bin 2679 -> 2683 bytes .../__pycache__/scrapper.cpython-312.pyc | Bin 7853 -> 7857 bytes .../threads_manager.cpython-312.pyc | Bin 10028 -> 10048 bytes src/services/scrapper.py | 2 +- src/services/threads_manager.py | 14 ++++---- .../centered_window.cpython-312.pyc | Bin 17200 -> 17041 bytes src/ui/centered_window.py | 17 ++++------ 16 files changed, 88 insertions(+), 21 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/MutiFunctionProgramProject.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 src/services/EmailClient.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/MutiFunctionProgramProject.iml b/.idea/MutiFunctionProgramProject.iml new file mode 100644 index 0000000..07abf20 --- /dev/null +++ b/.idea/MutiFunctionProgramProject.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..db8786c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e417eeb --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main.py b/src/main.py index 2e8efb1..8b1ade7 100644 --- a/src/main.py +++ b/src/main.py @@ -1,4 +1,4 @@ -from ui.centered_window import CenteredWindow +from src.ui.centered_window import CenteredWindow def main(): try: diff --git a/src/services/EmailClient.py b/src/services/EmailClient.py new file mode 100644 index 0000000..18917b3 --- /dev/null +++ b/src/services/EmailClient.py @@ -0,0 +1,30 @@ +import imaplib +import smtplib +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart + +class EmailClient: + def __init__(self, imap_server, smtp_server, email, password, imap_port=993, smtp_port=587): + self.imap_server = imap_server + self.smtp_server = smtp_server + self.email = email + self.password = password + self.imap_port = imap_port + self.smtp_port = smtp_port + self.imap_conn = None + self.smtp_conn = None + self.connect_imap() + self.connect_smtp() + + def connect_imap(self): + """Conexión del servidor IMAP""" + self.imap_conn = imaplib.IMAP4_SSL(self.imap_server, self.imap_port) + self.imap_conn.login(self.email, self.password) + + def connect_smtp(self): + """Conexión del servidor SMTP""" + self.smtp_conn = smtplib.SMTP(self.smtp_server, self.smtp_port) + self.smtp_conn.starttls() + self.smtp_conn.login(self.email, self.password) + + diff --git a/src/services/Radio_Player.py b/src/services/Radio_Player.py index 428b769..b8d384b 100644 --- a/src/services/Radio_Player.py +++ b/src/services/Radio_Player.py @@ -1,6 +1,6 @@ import vlc import time -from services.threaden_task import ThreadenTask +from src.services.threaden_task import ThreadenTask class RadioPlayer: def __init__(self): diff --git a/src/services/__pycache__/Radio_Player.cpython-312.pyc b/src/services/__pycache__/Radio_Player.cpython-312.pyc index 42f58a035c5e9cd719c93c5ea35c0c1f2384196d..e8dc4b66114dedc43d71d9fd4b76747f95f38b47 100644 GIT binary patch delta 56 zcmew^@>_)WG%qg~0}z~fT$gUMk++tS(Rp(>V><_{RB=(V-eh5}5CP-wEQ*Y_pBR8d I5kF8V0O*PjJpcdz delta 52 zcmew@@?C`YG%qg~0}vFU@a%HopL-1yx5yv&mPq9PWM3JDYyC8;GvnZ@zxiMgpotRQJo uko4raYT~StVAfW(NIB!X45oJ(^zSlg-DNQR&f>|$DE)~6L>5T`wEzIYi8;9d delta 90 zcmX@$x5kh6G%qg~0}vF6`s4ZFYkIcwd1V4T|3$MJ&C<}IB{ziJ9g|eZsJE8FHPB!u4i}0>y77O zof)U`LTU>V`Vvj7D@Y4S{Njf}m0B#+{)l*pzz;xbC?M1+RuNAvzbcVPs1g$A%s5VB zq^?%q+i?`$RuL`y@iKl|kvG(;>gN>dhN3hzojD>r0c3@66Wy=CM%zqwgV?DeQYD^v6 zrs`4Lm+MCq-BLg)oGa-C$|tS6?kVK$6!D$3rEGm}d zfdntrH~F0)yPkfL->Oe_v?I%!2R=`nfxMw>()b%_qDIL&* zU`O3#nt6~HN_r9cktjXlq!cv%X~WsQTMBG3XX*A1hn0AGb26MKsRDt*JuQO=_Tkd@T5`?=FHv_AIQ3m?DpuBX8ZWE4 zod@&WXi2bH{#r{{#7CTm5u|F&Eh{Mej1`)-)#SOf;2!c!B+KdHs0$TI@;KK{EZGO$eZnP{&C0CHQ(9J%C(L-&ve$X zpK`S`zRCIB&SEoZwnNxHc#k4QW4nP>-YIpkU-C0j6N(*djIX~W`NZWxvM@w2Od7l+ zbFzh{cNRC5D3Q}d7O{iZHVg6@B7`jEl9kOHssV0po+SYaH74lG^bp-_ZdHZtKcQbN z$>5|3o+EZldW}$_Oq2t|>Y}C_NqCw!cE7S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^JSRO_~?*hm#n zpcfEw?6pIuA{{Wa9HyK$s2jOqga$_1nux}l+givxJJHq=a3Q-FK=jjArnem-&#~{c zb&w_YtF|5&&+So0+T-MES!^GG@UbW2QMPjUnFvmz4yA5~rgcx#ZBL9QSXW}@5H4wX;h-rd zH@jzLG{eBv5c_+gfxO2)O|-&_8!gdtx9GGl52BnWd>E}bhUaAy3UU^Rtsu(IBHK=t z>{_)<&mqHWDo>hHMpt!O$yo{~V2&YiSMg)7WO=7rEZ4(@OL>{{^wIOE4#mLU>Zm0% z?A?wRf?oobjle6Jd6x?Votd4j-+cU{H4FLnR6g;C-xj&Xn_VYi~A%=>672!36AF^}Z+G!q9EN0jXKSDck5Ft^hhc#(= z)4FNunv{mPm|9E!wOg#rsQw62@p6mFot>vfJtceJ4nijr1j#vDH=bj3KbxBZ{dM6pDF8 zNgCl<0I=&T!j&kcOAv+veF}IJVvu(}%U@X$Tacgvy`TAo67)yE!Ex>KaHza9bfZj$vIzfLA zU|#v;MuhOXoB-|_|G-rV_OUB85*k;9SX&;708reBbs?J zkDIF$k9(WKuvp&9N;*yT%Z5TNuTe@Dsh&{`!?NjyRa1FYL8VbU>NbJWr96l`tIw^S z7n=jc&0Ngh9EvPEkq+&u@3wl1#bh<^hz$Ndl(fnNk>5pDct^?~ixR#T!FvzRv_q-$ zt*;4`A1`cRpLibB^lV90PSH<*Bx3-^0Ki9fLdb^DvLS>vggXAO*$`?sh5dgMdNzgQ fo5GPzp=(n}-gRAYkTc}Q%&ocAxsL@-aQpuQRPzFY diff --git a/src/ui/centered_window.py b/src/ui/centered_window.py index bea818b..485bfb4 100644 --- a/src/ui/centered_window.py +++ b/src/ui/centered_window.py @@ -1,16 +1,11 @@ -import customtkinter as ctk import tkinter as tk -import webbrowser -import subprocess -import os -import threading -from tkinter import filedialog -from services.threads_manager import ThreadsManager -from services.processes_manager import ProcessManager -from services.tetris_game import TetrisGame -from services.system_monitor import SystemMonitor -from services.Radio_Player import RadioPlayer +import customtkinter as ctk + +from src.services.processes_manager import ProcessManager +from src.services.system_monitor import SystemMonitor +from src.services.tetris_game import TetrisGame +from src.services.threads_manager import ThreadsManager class CenteredWindow(ctk.CTk):