-
Notifications
You must be signed in to change notification settings - Fork 1
/
gui.py
executable file
·310 lines (246 loc) · 11.5 KB
/
gui.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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# #!/usr/bin/env python3
import tkinter as tk
import tkinter.font as tkFont
from modules.leaksfinder import LeaksFinder
from modules.search import Search
from threading import Thread
# countries: Egypt, Cameroon, Algeria, Austria, Bahrain, Belgium, Canada, China, Cameroon, ShittyIsrael
from multiprocessing import Process
RootBG = '#202124'
class Gui(tk.Tk):
def __init__(self):
super().__init__()
self.Finder = Search()
self.font = tkFont.Font(family='Times bold',size=16)
self.__configure_root_window()
self.__configure_search_btn()
self.__configure_single_search_entry()
self.__configure_status_output()
self.__configure_result_output()
self.__configure_switch_mode_btn()
self.__LastStatus = ''
self.bind('<Return>', self.start_search)
# test = tk.StringVar(self)
# message = tk.Message(self)
def __configure_root_window(self):
self.title("Rummage")
self.config(background=RootBG)
width=1174
height=731
screenwidth = self.winfo_screenwidth()
screenheight = self.winfo_screenheight()
alignstr = '%dx%d+%d+%d' % (width, height, (screenwidth - width) / 2, (screenheight - height) / 2)
self.geometry(alignstr)
self.resizable(width=False, height=False)
def __configure_search_btn(self):
self.SearchBtn=tk.Button()
self.SearchBtn.config(
activebackground='#0061dc',
anchor='center',
bg='#0a56ba',
fg='white',
justify='center',
text='Search',
font=self.font,
command=self.start_search
)
self.SearchBtn.place(x=520,y=110,width=160,height=30)
def __configure_switch_mode_btn(self):
self.AnotherMode = tk.StringVar()
self.AnotherMode.set('Full Search')
self.SwitchModeBtn = tk.Button()
self.SwitchModeBtn.config(
activebackground='#0061dc',
anchor='center',
bg='#0a56b9',
fg='white',
justify='center',
font=self.font,
textvariable=self.AnotherMode,
command=self.switch_mode
)
self.SwitchModeBtn.place(x=520,y=170,width=160,height=30)
def clicked(self, event):
self.ClickedWidget.delete(0, tk.END)
def __configure_single_search_entry(self):
self.SingleSearchEntry = tk.Entry()
self.SingleSearchEntry.config(
borderwidth='1px',
font=self.font,
bg='#303134',
fg='white',
justify='center',
)
self.SingleSearchEntry.insert(0, 'Enter a Search Key')
self.ClickedWidget = self.SingleSearchEntry
self.SingleSearchEntry.bind('<Button-1>', self.clicked)
self.SingleSearchEntry.place(x=380,y=20,width=411,height=31)
def __configure_email_entry(self):
self.EmailLabel = tk.Label(text='Email: ',
font=self.font,
fg='white',
background=RootBG)
self.EmailLabel.place(x=10,y=87)
self.EmailEntry = tk.Entry()
self.EmailEntry.config(
borderwidth='1px',
font=self.font,
bg='#303134',
fg='white',
justify='center',
)
def __configure_phone_entry(self):
self.PhoneLabel = tk.Label(text='Phone Number: ',
font=self.font,
fg='white',
background=RootBG)
self.PhoneLabel.place(x=10,y=147)
self.PhoneEntry = tk.Entry()
self.PhoneEntry.config(
borderwidth='1px',
font=self.font,
bg='#303134',
fg='white',
justify='center'
)
def __configure_visa_entry(self):
self.VisaLabel = tk.Label(text='Visa(first 5 number-last 5): *****-*****',
font=self.font,
fg='white',
background=RootBG)
self.VisaLabel.place(x=770,y=87)
self.VisaEntry = tk.Entry()
self.VisaEntry.config(
borderwidth='1px',
font=self.font,
bg='#303134',
fg='white',
justify='center'
)
def __configure_username_entry(self):
self.UsernameLabel = tk.Label(text='Username: ',
font=self.font,
fg='white',
background=RootBG)
self.UsernameLabel.place(x=770,y=147)
self.UsernameEntry = tk.Entry()
self.UsernameEntry.config(
borderwidth='1px',
font=self.font,
bg='#303134',
fg='white',
justify='center'
)
def __show_full_search_widgets(self):
self.EmailEntry.place(x=10,y=110,width=390,height=30)
self.PhoneEntry.place(x=10,y=170,width=390,height=30)
self.VisaEntry.place(x=770,y=110,width=390,height=30)
self.UsernameEntry.place(x=770,y=170,width=390,height=30)
def __remove_full_search_widgets(self):
for Widget in self.FullSearchWidgets:
Widget.destroy()
def __check_status(self):
while not LeaksFinder.done:
if self.__LastStatus != LeaksFinder.GetStatus():
self.StatusText.config(state='normal')
self.StatusText.insert(tk.END, (LeaksFinder.GetStatus()))
self.__LastStatus = LeaksFinder.GetStatus()
self.StatusText.config(state='disabled')
def __configure_status_text(self):
self.StatusText = tk.Text(
self.StatusOutput,
font=self.font,
bg='#303134',
fg='white'
)
self.StatusText.grid(row=0, column=1)
self.StatusScroll = tk.Scrollbar(self.StatusOutput, command=self.StatusText.yview, background=RootBG, troughcolor=RootBG, activebackground='#e1e1e1')
self.StatusText.config(yscrollcommand=self.StatusScroll.set, state='disabled')
self.StatusScroll.grid(row=0, column=0, sticky=tk.NSEW)
def __configure_status_output(self):
self.status = tk.StringVar(self)
self.StatusOutput = tk.Label()
self.StatusOutput.config(
bg='#303134',
font=self.font,
fg='white',
textvariable=self.status,
anchor='n'
)
self.StatusOutput.place(x=10,y=270,width=573,height=453)
self.__configure_status_text()
self.CheckStatusThread = Thread(target=lambda: self.__check_status())
def __check_result(self):
while True:
if LeaksFinder.done:
self.ResultText.config(state='normal')
self.ResultText.insert('1.0', LeaksFinder.GetResult())
self.ResultText.config(state='disabled')
break
def __configure_result_text(self):
self.ResultText = tk.Text(
self.ResultOutput,
font=self.font,
bg='#303134',
fg='white'
)
self.ResultText.grid(row = 0, column = 1)
self.ResultScroll = tk.Scrollbar(self.ResultOutput, command=self.ResultText.yview, background=RootBG, troughcolor=RootBG, activebackground='#e1e1e1')
self.ResultText.config(yscrollcommand=self.ResultScroll.set, state='disabled')
self.ResultScroll.grid(row=0, column=0, sticky=tk.NSEW)
def __configure_result_output(self):
self.output = tk.StringVar()
self.ResultOutput=tk.Label()
self.CheckOutputThread = Thread(target=lambda: self.__check_result())
self.ResultOutput.config(
bg='#303134',
font=self.font,
fg='white',
textvariable=self.output,
anchor='n'
)
self.ResultOutput.place(x=590,y=270,width=576,height=452)
self.__configure_result_text()
def start_search(self, *event):
# self.FinderProc = Process(target= lambda: self.Finder.Search(self.SingleSearchEntry.get()))
# self.FinderProc.start()
self.StatusText.delete('1.0', tk.END)
self.ResultText.delete('1.0', tk.END)
self.FinderThread = Thread(target= lambda: self.Finder.Search(self.SingleSearchEntry.get()))
self.FinderThread.start()
self.CheckStatusThread.start()
self.CheckOutputThread.start()
def __switch_to_full_search(self):
self.AnotherMode.set('Single Search')
self.SingleSearchEntry.destroy()
self.__configure_email_entry()
self.__configure_phone_entry()
self.__configure_visa_entry()
self.__configure_username_entry()
self.__show_full_search_widgets()
self.FullSearchWidgets = [
self.EmailEntry,
self.PhoneEntry,
self.VisaEntry,
self.UsernameEntry,
self.EmailLabel,
self.PhoneLabel,
self.VisaLabel,
self.UsernameLabel
]
def __switch_to_single_search(self):
self.AnotherMode.set('Full Search')
self.__remove_full_search_widgets()
self.__configure_single_search_entry()
def switch_mode(self):
if self.AnotherMode.get() == 'Full Search':
self.__switch_to_full_search()
elif self.AnotherMode.get() == 'Single Search':
self.__switch_to_single_search()
# def __del__(self):
# # self.destroy()
# # print('stop now ')
# # del self.Finder
# # del self.FinderThread
app = Gui()
app.mainloop()