Passed
Pull Request — master (#39)
by Ram
01:00
created

AddOn.py (2 issues)

1
import tkinter
2
from tkinter import *
3
from tkinter import messagebox
4
import os
5
import pywhatkit
6
7
window = Tk()
8
window.overrideredirect(True)
9
window.geometry("150x400+908+130")
10
11
title_bar = Frame(window, bg='#4682b4', relief='ridge', bd=1, highlightcolor='#4682b4',highlightthickness=0)
12
title_name = Label(title_bar, text="FYIT ADDON", bg='#4682b4', fg="white")
13
#window.iconbitmap('Assets/YoutubeDownloader.ico')
14
15
def WhatsApp():
16
	try:
17
		window.destroy()
18
		import AutoWhatsApp
19
	except pywhatkit.InternetException:
20
		messagebox.showerror("No Internet", "Please Check the Internet Connection.")
21
22
def YSearchcall():
23
	try:
24
		window.destroy()
25
		import youtubesearch
26
	except pywhatkit.InternetException:
27
		messagebox.showerror("No Internet","Please Check the Internet Connection.")
28
29
def Ysearch():
30
	window.destroy()
31
	import youtubesearch
32
		
33
def closer():
34
	window.destroy()
35
	window.protocol("WM_DELETE_WINDOW")
36
37
def call_main():
38
	import Main
39
	window.update()
40
	
41
def cancel_shutdown():
42
	try:
43
		pywhatkit.cancelShutdown()
44
		messagebox.showinfo("Shutdown Cancelled.", "Shutdown Scheduled time cancelled Successfully.")
45
	except NameError:
46
		messagebox.showerror("No Schedule.", "Shutdown time is not defined.")
47
48
def show_hist():
49
	import WA_history
50
51
MainScreen_call = Button(window, text="Video Downloader",
52
                         cursor='hand2', command=call_main)
53
AppButton = Button(window, text="WhatsApp", cursor='hand2', command=WhatsApp)
54
AppButton1 = Button(window, text="FastYoutubeSearch",
55
                    cursor='hand2', command=YSearchcall)
56
closeButton = Button(window, text="Close", cursor='hand2', command=closer)
57
clr_shutdown = Button(window, text="Cancel Shutdown",
58
                      cursor='hand2', command=cancel_shutdown)
59
wb_hist = Button(window, text="View WhatsApp History",
60
                      cursor='hand2', command=show_hist)
61
62
title_bar.pack(fill=X)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable X does not seem to be defined.
Loading history...
63
title_name.pack(side=LEFT)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable LEFT does not seem to be defined.
Loading history...
64
65
AppButton.place(x=10,y=100)
66
AppButton1.place(x=10,y=150)
67
MainScreen_call.place(x=10,y=200)
68
wb_hist.place(x=10, y=250)
69
clr_shutdown.place(x=10, y=300)
70
closeButton.place(x=10,y=350)
71
72
window.config(bg="green")
73
window.update()
74
window.mainloop()
75