-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcap.py
209 lines (189 loc) · 6.4 KB
/
cap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
from tkinter import *
import os
import webbrowser
from datetime import datetime
import pandas as pd
from tkinter import messagebox
import gistyc
from tkinter.messagebox import askyesno
global gist_api
import sys
def myt():
webbrowser.open('https://youtube.com/playlist?list=PLht9SD0-LyQLGnW2bdHGIqf4Ni55PuoFx')
def img_resource_path(relative_path):
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
gist_api = gistyc.GISTyc(auth_token='<auth_token_here>')
def procap():
def btn_clicked():
print("Button Clicked")
def Close():
cap.destroy()
def clear(gen):
gen.delete("0","end")
def forms():
webbrowser.open("https://forms.gle/VkHR9uCtkb4FYA6S8")
def discord():
webbrowser.open('https://discord.gg/QbWru2bFtf')
def chain():
try:
try:
os.remove('user.csv')
os.rename('userdata','user.csv')
os.rename('user.csv','userdata')
except:
os.rename('userdata','user.csv')
os.rename('user.csv','userdata')
global opa,npa
opa=str(oldp.get())
npa=str(newp.get())
if len(npa)!=0:
try:
os.rename('userdata','user.csv')
except:
pass
nt=pd.read_csv('user.csv')
u=str(nt.loc[0,'0'])
gist_list = gist_api.get_gists()
tm=gist_list[5]['files']['dbase.csv']['raw_url']
t=pd.read_csv(tm)
d=t[t['user']==u].index.values
op=t.loc[d,'password'].values
os.rename('user.csv','userdata')
if opa==op and op!=npa:
t.loc[d,'password']=npa
t.to_csv('dbase.csv',index=False)
response_update_data = gist_api.update_gist(file_name='dbase.csv')
os.rename('dbase.csv','cache')
os.remove('cache')
os.remove('userdata')
messagebox.showinfo(parent=cap,title="password status changed",message="change complete ,login again")
Close()
if opa!=op and op!=npa:
messagebox.showwarning(parent=cap,title="password status Unchanged",message="Incorrect old password,Try again")
clear(oldp)
if opa==op and op==npa:
messagebox.showwarning(parent=cap,title="password status Unchanged",message="New password can't be same as old,Try again")
clear(newp)
if opa!=op and op==npa:
messagebox.showwarning(parent=cap,title="password status Unchanged",message="old or new password are same or wrong,Try again")
clear(oldp)
clear(newp)
if len(npa)==0:
messagebox.showwarning(parent=cap,title="status",message="New password cannot be left empty!")
except:
messagebox.showwarning(parent=cap,title="status",message="Please Login to change password!")
Close
cap = Toplevel()
cap.geometry("1280x720")
cap.overrideredirect(True)
cap.configure(bg = "#000000")
def center_screen():
global screen_height, screen_width, x_cordinate, y_cordinate
screen_width = cap.winfo_screenwidth()
screen_height = cap.winfo_screenheight()
x_cordinate = int((screen_width/2) - (1280/2))
y_cordinate = int((screen_height/2) - (720/2))
cap.geometry("{}x{}+{}+{}".format(1280,720, x_cordinate, y_cordinate))
center_screen()
canvas = Canvas(
cap,
bg = "#000000",
height = 720,
width = 1280,
bd = 0,
highlightthickness = 0,
relief = "ridge")
canvas.place(x = 0, y = 0)
background_img = PhotoImage(file =img_resource_path("pasres.png"))
background = canvas.create_image(
640.0, 363.5,
image=background_img)
ytim = PhotoImage(file = img_resource_path("nytb.png"))
ytb = Button(cap,
image = ytim,
borderwidth = 0,
highlightthickness = 0,
command = myt,
relief = "flat")
ytb.place(
x = 1183, y = 365,
width = 62,
height = 43)
img0 = PhotoImage(file =img_resource_path("exit.png"))
ext = Button(cap,
image = img0,
borderwidth = 0,
highlightthickness = 0,
command = Close,
relief = "flat")
ext.place(
x = 1174, y = 627,
width = 88,
height = 69)
img1 = PhotoImage(file =img_resource_path("mail.png"))
mail = Button(cap,
image = img1,
borderwidth = 0,
highlightthickness = 0,
command = forms,
relief = "flat")
mail.place(
x = 1174, y = 540,
width = 83,
height = 69)
img2 = PhotoImage(file =img_resource_path("discord.png"))
dis = Button(cap,
image = img2,
borderwidth = 0,
highlightthickness = 0,
command = discord,
relief = "flat")
dis.place(
x = 1167, y = 429,
width = 99,
height = 93)
entry0_img = PhotoImage(file =img_resource_path("ptbo.png"))
entry0_bg = canvas.create_image(
506.5, 399.5,
image = entry0_img)
oldp = Entry(cap,font=('Open Sans',20),
fg = '#ffffff',
bd = 0,
bg = "#170423",
highlightthickness = 0)
oldp.place(
x = 308.0, y = 360,
width = 397.0,
height = 77)
entry1_img = PhotoImage(file =img_resource_path("ptbn.png"))
entry1_bg = canvas.create_image(
506.5, 519.0,
image = entry1_img)
newp = Entry(cap,font=('Open Sans',20),
fg = '#ffffff',
bd = 0,
bg = "#170423",
highlightthickness = 0)
newp.place(
x = 308.0, y = 478,
width = 397.0,
height = 80)
img3 = PhotoImage(file =img_resource_path("subt.png"))
submit = Button(cap,
image = img3,
borderwidth = 0,
highlightthickness = 0,
command = chain,
relief = "flat")
submit.place(
x = 813, y = 393,
width = 202,
height = 113)
cap.grab_set()
cap.resizable(False, False)
cap.mainloop()