1 from tkinter import Tk,Label,Entry,StringVar,IntVar,Checkbutton,Button,Text,END,messagebox
\r
2 from tkinter.ttk import Scrollbar
\r
5 import ext.crud as crud
\r
9 from email.mime.text import MIMEText
\r
11 from color import Color
\r
16 global theme2,color,color2,banner,banner1,banner_name2
\r
18 theme=io.open("configs\\themes\\theme.thm","r")
\r
19 theme2=theme.readlines()
\r
20 print("THEME-NAME: ",theme2[0].rstrip(" \n"))
\r
22 color_class=Color(theme2[1].rstrip(" \n"))
\r
24 color_class=Color("#000000")
\r
25 color=color_class.get()
\r
27 color2_class=Color(theme2[2].rstrip("\n"))
\r
28 color2=color2_class.get()
\r
29 banner=Color(theme2[3].rstrip("\n"))
\r
30 banner1=Color(theme2[4].rstrip("\n"))
\r
32 banner1=banner1.get()
\r
33 banner_name2=theme2[5].rstrip("\n")
\r
37 messagebox.showwarning("ColorError","Uno/s color no esta bien escrito")
\r
45 os.mkdir("configs\\themes")
\r
48 theme=io.open("configs\\themes\\theme.thm","w")
\r
49 theme.write("Photoshop-theme\n#5e5c5c\n#ffffff\n#5e5c5c\n#ffffff\nSERVIDOR FTP V6.5")
\r
51 theme=io.open("configs\\themes\\theme.thm","r")
\r
52 theme2=theme.readlines()
\r
54 color_class=Color(theme2[1].rstrip(" \n"))
\r
55 color=color_class.get()
\r
56 color2_class=Color(theme2[2].rstrip(" \n"))
\r
57 color2=color2_class.get()
\r
58 banner=Color(theme2[3].rstrip("\n"))
\r
59 banner1=Color(theme2[4].rstrip("\n"))
\r
61 banner1=banner1.get()
\r
62 banner_name2=theme2[5].rstrip(" \n")
\r
64 print("THEME-NAME: ",theme2[0].rstrip(" \n"))
\r
70 root.title("Puntuanos")
\r
71 root.geometry("340x220")
\r
72 root.config(bg=color)
\r
77 user.set(getpass.getuser())
\r
89 l1=Label(text="Usuario",fg=color2,bg=color)
\r
92 l2=Label(text="Mensaje",fg=color2,bg=color)
\r
93 l2.place(x=30,y=110)
\r
95 l3=Label(text="Puntuación",fg=color2,bg=color)
\r
98 e1=Entry(textvariable=user,width=32,fg=color2,bg=color)
\r
99 e1.place(x=100,y=20)
\r
101 t1=Text(width=24,height=3,fg=color2,bg=color)
\r
102 t1.insert(0.1,"La app me a encantado")
\r
103 s1=Scrollbar(command=t1.yview)
\r
104 s1.place(x=300,y=95)
\r
105 t1.place(x=100,y=95)
\r
106 t1.config(yscrollcommand=s1.set)
\r
110 if r5.get()==1 or r4.get()==1 or r3 .get()==1 or r2.get()==1:
\r
123 if r5.get()==1 or r4.get()==1 or r3.get()==1 or r1.get()==1:
\r
136 if r5.get()==1 or r4.get()==1 or r2.get()==1 or r1.get()==1:
\r
150 if r5.get()==1 or r3.get()==1 or r2.get()==1 or r1.get()==1:
\r
185 c_1=Checkbutton(variable=r1,onvalue=1,offvalue=0,command=punt1,selectcolor=color,fg=color2,bg=color,overrelief="sunken")
\r
186 c_2=Checkbutton(variable=r2,onvalue=1,offvalue=0,command=punt2,selectcolor=color,fg=color2,bg=color,overrelief="sunken")
\r
187 c_3=Checkbutton(variable=r3,onvalue=1,offvalue=0,command=punt3,selectcolor=color,fg=color2,bg=color,overrelief="sunken")
\r
188 c_4=Checkbutton(variable=r4,onvalue=1,offvalue=0,command=punt4,selectcolor=color,fg=color2,bg=color,overrelief="sunken")
\r
189 c_5=Checkbutton(variable=r5,onvalue=1,offvalue=0,command=punt5,selectcolor=color,fg=color2,bg=color,overrelief="sunken")
\r
190 c_1.place(y=62,x=125)
\r
191 c_2.place(y=62,x=155)
\r
192 c_3.place(y=62,x=185)
\r
193 c_4.place(y=62,x=215)
\r
194 c_5.place(y=62,x=245)
\r
200 mailServer = smtplib.SMTP('smtp.nauta.cu',25)
\r
202 mailServer.starttls()
\r
204 mailServer.login("borisdanielmm@nauta.cu",crud.decode("YmFsYmlub3RBMTIu"))
\r
205 mensaje = MIMEText("\n"+"Puntuación: "+punt+"\n"+t1.get("1.0",END))
\r
206 mensaje['From']="borisdanielmm@nauta.cu"
\r
207 mensaje['To']="borisdanielmm@nauta.cu"
\r
208 mensaje['Subject']="Calificación"
\r
209 # Envio del mensaje
\r
210 mailServer.sendmail("borisdanielmm@nauta.cu",
\r
211 "borisdanielmm@nauta.cu",
\r
212 mensaje.as_string())
\r
215 b1=Button(text="Enviar",overrelief="sunken",command=send,fg=color2,bg=color,width=20)
\r
216 b1.place(x=92,y=170)
\r