-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_old.py
1723 lines (1548 loc) · 74.2 KB
/
main_old.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tkcalendar import DateEntry
from pathlib import Path
import os
import git
import sys
from sys import platform
from subprocess import Popen, check_call
import warnings
import shutil
from settings import PYTHON_EXE, CHROME_USER_DATA
from tktimepicker import SpinTimePickerOld
from modules.database import Database
from datetime import datetime, timedelta
db = Database("dbresy.db")
warnings.filterwarnings("ignore", category=UserWarning)
if platform == "linux" or platform == "linux2":
pass
elif platform == "win32":
from subprocess import CREATE_NEW_CONSOLE
import json
warnings.filterwarnings("ignore", category=UserWarning)
if platform == "linux" or platform == "linux2":
pass
elif platform == "win32":
from subprocess import CREATE_NEW_CONSOLE
import json
def savejson(filename, valuelist, value=False):
# breakpoint()
if value:
file = open(filename, "r")
tmplist = json.load(file)
found = False
# breakpoint()
for lst1 in tmplist:
if lst1['profilename'] == value:
messagebox.showerror("Message box","profile name found")
found = True
break
# breakpoint()
if not found:
with open(filename, "w") as final:
json.dump(valuelist, final)
return True
else:
return False
else:
# breakpoint()
with open(filename, "w") as final:
try:
json.dump(valuelist.get(0, END), final)
except:
json.dump(valuelist, final)
return True
def convert24time(vtime):
hour = str(vtime.hours())
period = vtime.period().replace(".","").upper()
if len(str(vtime.minutes())) == 1:
minute = f"0{str(vtime.minutes())}"
else:
minute = str(vtime.minutes())
return f"{hour}:{minute} {period}"
def convert24timeSecond(vtime):
hour = str(vtime.hours())
period = vtime.period().replace(".","").upper()
if len(str(vtime.minutes())) == 1:
minute = f"0{str(vtime.minutes())}"
else:
minute = str(vtime.minutes())
if len(str(vtime.seconds())) == 1:
second = f"0{str(vtime.seconds())}"
else:
second = str(vtime.seconds())
return f"{hour}:{minute}:{second} {period}"
class Window(Tk):
def __init__(self) -> None:
super().__init__()
self.title('Resy.com Bot Application @2024')
# self.resizable(0, 0)
self.gitme = git.cmd.Git(os.getcwd())
self.gitme.fetch()
# breakpoint()
self.grid_propagate(False)
width = 1300
height = 720
swidth = self.winfo_screenwidth()
sheight = self.winfo_screenheight()
newx = int((swidth/2) - (width/2))
newy = int((sheight/2) - (height/2))
self.geometry(f"{width}x{height}+{newx}+{newy}")
self.columnconfigure(0, weight=1)
self.columnconfigure(1, weight=1)
self.columnconfigure(2, weight=1)
self.columnconfigure(3, weight=1)
self.rowconfigure(0, weight=1)
exitButton = ttk.Button(self, text="Exit", command=lambda:self.procexit())
pullButton = Button(self, text='Update Script', command=lambda:self.gitPull())
# settingButton = ttk.Button(self, text='Chrome Setup', command=lambda:chromeSetup())
exitButton.grid(row=2, column=3, sticky=(E), padx=20, pady=5)
pullButton.grid(row=2, column=0, sticky = (W), padx=20, pady=5)
if not "up to date" in self.gitme.status():
pullButton['state'] = "normal"
pullButton['bg'] = "red"
else:
pullButton['state'] = "disabled"
mainFrame = MainFrame(self)
mainFrame.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
def gitPull(self):
self.gitme.pull()
run_module(comlist=[PIPLOC, "install", "-r", "requirements.txt"])
# with open("commandlist.json", "w") as final:
# json.dump([], final)
messagebox.showinfo(title='Info', message='the scripts has updated, reopen the application...')
sys.exit()
def procexit(self):
try:
for p in Path(".").glob("__tmp*"):
p.unlink()
except:
pass
sys.exit()
class MainFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
# self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=2)
framestyle = ttk.Style()
framestyle.configure('TFrame', background='#C1C1CD')
self.config(padding="20 20 20 20", borderwidth=1, relief='groove', style='TFrame')
# self.place(anchor=CENTER)
self.columnconfigure(0, weight=1)
self.columnconfigure(1, weight=1)
self.columnconfigure(2, weight=1)
# self.columnconfigure(3, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
self.rowconfigure(9, weight=1)
self.rowconfigure(10, weight=1)
titleLabel = TitleLabel(self, 'Main Menu')
# resybotv2Button = FrameButton(self, window, text="Resy Bot v2", class_frame=ResyBotv2Frame)
# resybotv3Button = FrameButton(self, window, text="Resy Bot v3", class_frame=ResyBotv3Frame)
resybotv4Button = FrameButton(self, window, text="Resy Bot Form", class_frame=ResyBotv5Frame)
listbookButton = FrameButton(self, window, text="List of Bookings", class_frame=ListCommandV4bFrame)
reservationlistButton = FrameButton(self, window, text="Update Reservation Type", class_frame=AddReservationFrame)
# periodlistButton = FrameButton(self, window, text="Update Period", class_frame=AddPeriodFrame)
chromiumProfileButton = FrameButton(self, window, text="Update Chromium Profile", class_frame=ChromiumProfileFrame)
# setupChromiumButton = FrameButton(self, window, text="Chromium Profile Tester", class_frame=SetupChromiumFrame)
UpdateTokenButton = FrameButton(self, window, text="Update Profile Token", class_frame=UpdateTokenFrame)
proxyProfileButton = FrameButton(self, window, text="Update Proxy Profle", class_frame=ProxyProfileFrame)
# # # layout
titleLabel.grid(column = 0, row = 0, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
# resybotv2Button.grid(column = 0, row = 1, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
# resybotv3Button.grid(column = 0, row = 2, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
resybotv4Button.grid(column = 0, row = 1, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
listbookButton.grid(column = 0, row = 2, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
reservationlistButton.grid(column = 0, row = 3, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
# periodlistButton.grid(column = 0, row = 4, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
chromiumProfileButton.grid(column = 0, row = 4, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
# setupChromiumButton.grid(column = 0, row = 7, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
UpdateTokenButton.grid(column = 0, row = 5, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
proxyProfileButton.grid(column = 0, row = 6, sticky=(W, E, N, S), padx=15, pady=5, columnspan=3)
class AddReservationFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
file = open("reservationlist.json", "r")
listvalue = json.load(file)
tmplist = [value for value in listvalue]
setlist = set(tmplist)
RESERVATION_LIST = sorted(list(setlist), key=str.casefold)
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
titleLabel = TitleLabel(self, text="Update Reservation Type")
valuentry = Entry(self, width=80)
dlist = StringVar(value=RESERVATION_LIST)
self.valueslist = Listbox(self, width=80, height=10, listvariable=dlist)
self.valueslist.bind( "<Double-Button-1>" , self.removeValue)
addButton = ttk.Button(self, text='Add', command = lambda:self.addlist(entry=valuentry, valuelist=self.valueslist))
saveButton = ttk.Button(self, text='Save', command = lambda:self.savelist(valuelist=self.valueslist))
closeButton = CloseButton(self)
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S))
valuentry.grid(column = 0, row = 1, sticky=(W))
addButton.grid(column = 0, row = 1, sticky = (E))
self.valueslist.grid(column = 0, row = 2, sticky=(W))
# saveButton.grid(column = 0, row = 3, sticky = (W,N))
closeButton.grid(column = 0, row = 8, sticky = (E))
def removeValue(self, event):
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
selection = self.valueslist.curselection()
for i in self.valueslist.curselection():
messagebox.showinfo("Message box", f"`{self.valueslist.get(i)}` deleted..")
self.valueslist.delete(selection)
savejson(filename="reservationlist.json", valuelist=self.valueslist)
def savelist(self, **kwargs):
with open("reservationlist.json", "w") as final:
json.dump(kwargs['valuelist'].get(0, END), final)
messagebox.showinfo("Message box","Reservation List saved..")
def addlist(self, **kwargs):
kwargs['valuelist'].insert(0, kwargs['entry'].get())
kwargs['entry'].delete(0, END)
savejson(filename="reservationlist.json", valuelist=kwargs['valuelist'])
messagebox.showinfo("Message box","New Reservation added..")
class AddPeriodFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
file = open("periodlist.json", "r")
listvalue = json.load(file)
tmplist = [value for value in listvalue]
setlist = set(tmplist)
PERIOD_LIST = sorted(list(setlist), key=str.casefold)
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
titleLabel = TitleLabel(self, text="Update Period")
valuentry = Entry(self, width=80)
dlist = StringVar(value=PERIOD_LIST)
self.valueslist = Listbox(self, width=80, height=10, listvariable=dlist)
self.valueslist.bind( "<Double-Button-1>" , self.removeValue)
addButton = ttk.Button(self, text='Add', command = lambda:self.addlist(entry=valuentry, valuelist=self.valueslist))
saveButton = ttk.Button(self, text='Save', command = lambda:self.savelist(valuelist=self.valueslist))
closeButton = CloseButton(self)
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S))
valuentry.grid(column = 0, row = 1, sticky=(W))
addButton.grid(column = 0, row = 1, sticky = (E))
self.valueslist.grid(column = 0, row = 2, sticky=(W))
# saveButton.grid(column = 0, row = 3, sticky = (W,N))
closeButton.grid(column = 0, row = 8, sticky = (E))
def removeValue(self, event):
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
selection = self.valueslist.curselection()
for i in self.valueslist.curselection():
messagebox.showinfo("Message box", f"`{self.valueslist.get(i)}` deleted..")
self.valueslist.delete(selection)
savejson(filename="periodlist.json", valuelist=self.valueslist)
def savelist(self, **kwargs):
with open("periodlist.json", "w") as final:
json.dump(kwargs['valuelist'].get(0, END), final)
messagebox.showinfo("Message box","Period List saved..")
def addlist(self, **kwargs):
kwargs['valuelist'].insert(0, kwargs['entry'].get())
kwargs['entry'].delete(0, END)
savejson(filename="periodlist.json", valuelist=kwargs['valuelist'])
messagebox.showinfo("Message box","New Period added..")
class ChromiumProfileFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
file = open("profilelist.json", "r")
self.profilelist = json.load(file)
PROFILE_LIST = [f"{value['profilename']} | {value['email']} | {value['password']}" for value in self.profilelist]
# setlist = set(tmplist)
# PROFILE_LIST = sorted(self.profilelist, key=str.casefold)
# breakpoint()
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
titleLabel = TitleLabel(self, text="Update Chromium Profile")
profilenamentry = EntryWithPlaceholder(self, width=80, placeholder="Profile Name (Space Not allowed)")
emailentry = EntryWithPlaceholder(self, width=80, placeholder="Email")
passwordentry = EntryWithPlaceholder(self, width=80, placeholder="Password")
dlist = StringVar(value=PROFILE_LIST)
self.valueslist = Listbox(self, width=80, height=10, listvariable=dlist)
self.valueslist.bind( "<Double-Button-1>" , self.removeValue)
addButton = ttk.Button(self, text='Add', command = lambda:self.addlist(profilename=profilenamentry, email=emailentry, password=passwordentry, valuelist=self.valueslist))
saveButton = ttk.Button(self, text='Save', command = lambda:self.savelist(valuelist=self.valueslist))
closeButton = CloseButton(self)
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S))
profilenamentry.grid(column = 0, row = 1, sticky=(W))
emailentry.grid(column = 0, row = 2, sticky=(W))
passwordentry.grid(column = 0, row = 3, sticky=(W))
self.valueslist.grid(column = 0, row = 4, sticky=(W))
addButton.grid(column = 0, row = 1, sticky = (E))
# saveButton.grid(column = 0, row = 3, sticky = (W,N))
closeButton.grid(column = 0, row = 8, sticky = (E))
def removeValue(self, event):
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
selection = self.valueslist.curselection()
for i in self.valueslist.curselection():
strselect = self.valueslist.get(i).split(" | ")[0]
messagebox.showinfo("Message box", f"`{strselect}` deleted..")
self.valueslist.delete(selection)
tmplist = []
for dl in self.profilelist:
if dl['profilename'] != strselect:
tmplist.append(dl)
self.profilelist = tmplist.copy()
savejson(filename="profilelist.json", valuelist=self.profilelist)
try:
shutil.rmtree(CHROME_USER_DATA + os.path.sep + strselect)
except:
pass
def addlist(self, **kwargs):
self.profilelist.append({"profilename": kwargs['profilename'].get(), "email": kwargs['email'].get(), "password": kwargs['password'].get()})
if savejson(filename="profilelist.json", valuelist=self.profilelist, value=kwargs['profilename'].get()):
kwargs['valuelist'].insert(0, f"{kwargs['profilename'].get()} | {kwargs['email'].get()} | {kwargs['password'].get()}")
else:
# breakpoint()
self.profilelist.pop()
kwargs['profilename'].delete(0, END)
kwargs['email'].delete(0, END)
kwargs['password'].delete(0, END)
# messagebox.showinfo("Message box","New Period added..")
class ProxyProfileFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
file = open("proxylist.json", "r")
self.proxylist = json.load(file)
PROXY_LIST = [f"{value['profilename']} | {value['http_proxy']} | {value['https_proxy']}" for value in self.proxylist]
# setlist = set(tmplist)
# PROFILE_LIST = sorted(self.profilelist, key=str.casefold)
# breakpoint()
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
self.rowconfigure(9, weight=1)
self.rowconfigure(10, weight=1)
self.rowconfigure(11, weight=1)
self.rowconfigure(12, weight=1)
titleLabel = TitleLabel(self, text="Update Proxy Profile")
profilenamentry = EntryWithPlaceholder(self, width=110, placeholder="Profile Name (Space is not allowed)")
httpproxyentry = EntryWithPlaceholder(self, width=110, placeholder="HTTP Proxy: proxy_type://username:password@proxy_address:port_number")
httpsproxyentry = EntryWithPlaceholder(self, width=110, placeholder="HTTPS Proxy: proxy_type://username:password@proxy_address:port_number")
dlist = StringVar(value=PROXY_LIST)
self.valueslist = Listbox(self, width=110, height=10, listvariable=dlist)
self.valueslist.bind( "<Double-Button-1>" , self.removeValue)
addButton = ttk.Button(self, text='Add', command = lambda:self.addlist(profilename=profilenamentry, http_proxy=httpproxyentry, https_proxy=httpsproxyentry, valuelist=self.valueslist))
closeButton = CloseButton(self)
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S))
profilenamentry.grid(column = 0, row = 1, sticky=(W))
httpproxyentry.grid(column = 0, row = 2, sticky=(W))
httpsproxyentry.grid(column = 0, row = 3, sticky=(W))
self.valueslist.grid(column = 0, row = 4, sticky=(W))
addButton.grid(column = 0, row = 1, sticky = (E))
closeButton.grid(column = 0, row = 4, sticky = (E, S))
def removeValue(self, event):
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
selection = self.valueslist.curselection()
for i in self.valueslist.curselection():
strselect = self.valueslist.get(i).split(" | ")[0]
messagebox.showinfo("Message box", f"`{strselect}` deleted..")
self.valueslist.delete(selection)
tmplist = []
for dl in self.proxylist:
if dl['profilename'] != strselect:
tmplist.append(dl)
self.proxylist = tmplist.copy()
savejson(filename="proxylist.json", valuelist=self.proxylist)
def addlist(self, **kwargs):
self.proxylist.append({"profilename": kwargs['profilename'].get(), "http_proxy": kwargs['http_proxy'].get(), "https_proxy": kwargs['https_proxy'].get()})
if savejson(filename="proxylist.json", valuelist=self.proxylist, value=kwargs['profilename'].get()):
kwargs['valuelist'].insert(0, f"{kwargs['profilename'].get()} | {kwargs['http_proxy'].get()} | {kwargs['https_proxy'].get()}")
else:
# breakpoint()
self.proxylist.pop()
kwargs['profilename'].delete(0, END)
kwargs['http_proxy'].delete(0, END)
kwargs['https_proxy'].delete(0, END)
# messagebox.showinfo("Message box","New Period added..")
class SetupChromiumFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.columnconfigure(0, weight=1)
self.columnconfigure(1, weight=1)
self.columnconfigure(2, weight=1)
# self.columnconfigure(3, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
titleLabel = TitleLabel(self, 'Chromium Profiles')
closeButton = CloseButton(self)
file = open("profilelist.json", "r")
profilelisttmp = json.load(file)
profileList = []
for text in [value['profilename'] for value in profilelisttmp]:
profileList.append(ttk.Button(self, text=text, command=lambda pro=text:self.chromeTester(pro)))
# layout
titleLabel.grid(column = 0, row = 0, sticky=(W, E, N, S), padx=15, pady=5, columnspan=4)
closeButton.grid(column = 0, row = 6, sticky = (E, N, S), columnspan=4)
colnum = 0
rownum = 1
for profile in profileList:
if colnum == 3:
colnum = 0
rownum += 1
profile.grid(column = colnum, row = rownum, sticky=(W, E, N, S), padx=15, pady=5)
colnum += 1
def chromeTester(self, profile):
file = open("profilelist.json", "r")
profilelisttmp = json.load(file)
profileselected = [value for value in profilelisttmp if value['profilename']==profile]
run_module(comlist=[PYLOC, "modules/chromium_setup.py", "-cp", profile, "-em", profileselected[0]['email'], "-pw", profileselected[0]['password'] ])
class UpdateTokenFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.columnconfigure(0, weight=1)
self.columnconfigure(1, weight=1)
self.columnconfigure(2, weight=1)
# self.columnconfigure(3, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
titleLabel = TitleLabel(self, 'Update Token Profile')
closeButton = CloseButton(self)
file = open("profilelist.json", "r")
profilelisttmp = json.load(file)
profileList = []
for text in [value['profilename'] +"\n" + value["email"] for value in profilelisttmp]:
profileList.append(ttk.Button(self, text=text, command=lambda pro=text:self.chromeTester(pro)))
# layout
titleLabel.grid(column = 0, row = 0, sticky=(W, E, N, S), padx=15, pady=5, columnspan=4)
closeButton.grid(column = 0, row = 6, sticky = (E, N, S), columnspan=4)
colnum = 0
rownum = 1
for profile in profileList:
if colnum == 3:
colnum = 0
rownum += 1
profile.grid(column = colnum, row = rownum, sticky=(W, E, N, S), padx=15, pady=5)
colnum += 1
def chromeTester(self, profile):
file = open("profilelist.json", "r")
profilelisttmp = json.load(file)
profileselected = [value for value in profilelisttmp if value['profilename'] +"\n" + value["email"]==profile]
run_module(comlist=[PYLOC, "modules/update_token.py", "-cp", profileselected[0]['profilename'], "-em", profileselected[0]['email'], "-pw", profileselected[0]['password'] ])
class ListCommandFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
file = open("commandlist.json", "r")
self.commandlist = json.load(file)
commandlist = ["{} | {} | {} | {} | {} | {}".format(str(value['baseurl']).split("/")[-1], value['date'], value['time'], value['seats'], value['period'], value['reservation_type'] ) for value in self.commandlist]
file = open("profilelist.json", "r")
self.profilelist = json.load(file)
PROFILE_LIST = [f"{value['profilename']} | {value['email']} | {value['password']}" for value in self.profilelist]
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
titleLabel = TitleLabel(self, text="List Bot's Command")
dlist = StringVar(value=commandlist)
self.valueslist = Listbox(self, width=120, height=10, listvariable=dlist)
self.valueslist.bind( "<Double-Button-1>" , self.removeValue)
chprofilelabel = Label(self, text="Chromium Profile: ")
headlesslabel = Label(self, text="Headless Mode: ")
proclabel = Label(self, text="Execute Mode: ")
nstoplabel = Label(self, text="Nonstop Checking: ")
closeButton = CloseButton(self)
chprofileentry = ttk.Combobox(self, textvariable=StringVar(), state="readonly", width=30)
chprofileentry['values'] = [profile for profile in PROFILE_LIST]
chprofileentry.current(0)
headlessentry = ttk.Combobox(self, textvariable=StringVar(), state="readonly", width=5)
headlessentry['values'] = ['No','Yes']
headlessentry.current(0)
procentry = ttk.Combobox(self, textvariable=StringVar(), state="readonly", width=10)
procentry['values'] = ['Single','Multiple']
procentry.current(0)
nstopentry = ttk.Combobox(self, textvariable=StringVar(), state="readonly", width=5)
nstopentry['values'] = ['No','Yes']
nstopentry.current(0)
runButton = ttk.Button(self, text='Run Process', command = lambda:self.run_process(profile=chprofileentry, headless=headlessentry, exemode=procentry, nstop=nstopentry))
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S))
self.valueslist.grid(column = 0, row = 1, sticky=(W))
chprofilelabel.grid(column = 0, row = 2, sticky=(W))
chprofileentry.grid(column = 0, row = 2, sticky=(E))
headlesslabel.grid(column = 0, row = 3, sticky=(W))
headlessentry.grid(column = 0, row = 3, sticky=(E))
proclabel.grid(column = 0, row = 4, sticky=(W))
procentry.grid(column = 0, row = 4, sticky=(E))
nstoplabel.grid(column = 0, row = 5, sticky=(W))
nstopentry.grid(column = 0, row = 5, sticky=(E))
runButton.grid(column = 0, row = 6, sticky = (E))
closeButton.grid(column = 0, row = 7, sticky = (E))
def removeValue(self, event):
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
selection = self.valueslist.curselection()
for i in self.valueslist.curselection():
strselect = self.valueslist.get(i)
messagebox.showinfo("Message box", f"`{strselect}` deleted..")
self.valueslist.delete(selection)
tmplist = []
for dl in self.commandlist:
if "{} | {} | {} | {} | {} | {}".format(str(dl['baseurl']).split("/")[-1], dl['date'], dl['time'], dl['seats'], dl['period'], dl['reservation_type']) != strselect:
tmplist.append(dl)
self.commandlist = []
self.commandlist = tmplist.copy()
savejson(filename="commandlist.json", valuelist=self.commandlist)
def run_process(self, **kwargs):
profile = kwargs['profile'].get().split("|")[0].strip()
email = kwargs['profile'].get().split("|")[1].strip()
password = kwargs['profile'].get().split("|")[2].strip()
if kwargs['exemode'].get() == 'Single':
run_module(comlist=[PYLOC, "modules/resybotv3.py", "-cp", profile, "-em", email, "-pw", password, "-hl", '{}'.format(kwargs['headless'].get())])
else:
for command in self.commandlist:
run_module(comlist=[PYLOC, "modules/resybotv3b.py", "-u", '{}'.format(command['baseurl']), "-d", '{}'.format(command['date']), "-t", '{}'.format(command['time']), "-s", '{}'.format(command['seats']), "-p", '{}'.format(command['period']), "-r", '{}'.format(command['reservation_type']), "-cp", profile, "-em", email, "-pw", password, "-hl", '{}'.format(kwargs['headless'].get()), "-ns", '{}'.format(kwargs['nstop'].get())])
class ListCommandV4Frame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
file = open("commandlist.json", "r")
self.commandlist = json.load(file)
commandlist = ["{} | {} | {} | {} | {}".format(str(value['baseurl']).split("/")[-1], value['date'], value['time'], value['seats'], value['reservation_type'] ) for value in self.commandlist]
file = open("profilelist.json", "r")
self.profilelist = json.load(file)
PROFILE_LIST = [f"{value['profilename']} | {value['email']} | {value['password']}" for value in self.profilelist]
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
titleLabel = TitleLabel(self, text="List Bot's Command")
dlist = StringVar(value=commandlist)
self.valueslist = Listbox(self, width=120, height=10, listvariable=dlist)
self.valueslist.bind( "<Double-Button-1>" , self.removeValue)
chprofilelabel = Label(self, text="Account: ")
rotatelabel = Label(self, text="Rotating Account: ")
datelabel = Label(self, text="Bot Run Date: ")
timelabel = Label(self, text="Bot Run Time: ")
closeButton = CloseButton(self)
chprofileentry = ttk.Combobox(self, textvariable=StringVar(), state="readonly", width=30)
chprofileentry['values'] = [profile for profile in PROFILE_LIST]
chprofileentry.current(0)
dateentry = DateEntry(self, width= 20, date_pattern='mm/dd/yyyy')
timeentry = SpinTimePickerOld(self)
timeentry.addHours12()
timeentry.addMinutes()
timeentry.addPeriod()
rotateentry = ttk.Combobox(self, textvariable=StringVar(), state="readonly", width=5)
rotateentry['values'] = ['No','Yes']
rotateentry.current(0)
runButton = ttk.Button(self, text='Run Process', command = lambda:self.run_process(profile=chprofileentry, date=dateentry, time=timeentry, rotate=rotateentry))
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S))
self.valueslist.grid(column = 0, row = 1, sticky=(W))
chprofilelabel.grid(column = 0, row = 2, sticky=(W))
chprofileentry.grid(column = 0, row = 2, sticky=(E))
rotatelabel.grid(column = 0, row = 3, sticky=(W))
rotateentry.grid(column = 0, row = 3, sticky=(E))
datelabel.grid(column = 0, row = 4, sticky=(W))
dateentry.grid(column = 0, row = 4, sticky=(E))
timelabel.grid(column = 0, row = 5, sticky=(W))
timeentry.grid(column = 0, row = 5, sticky=(E))
runButton.grid(column = 0, row = 6, sticky = (E))
closeButton.grid(column = 0, row = 7, sticky = (E))
def removeValue(self, event):
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
selection = self.valueslist.curselection()
for i in self.valueslist.curselection():
strselect = self.valueslist.get(i)
messagebox.showinfo("Message box", f"`{strselect}` deleted..")
self.valueslist.delete(selection)
tmplist = []
for dl in self.commandlist:
if "{} | {} | {} | {} | {}".format(str(dl['baseurl']).split("/")[-1], dl['date'], dl['time'], dl['seats'], dl['reservation_type']) != strselect:
tmplist.append(dl)
self.commandlist = []
self.commandlist = tmplist.copy()
savejson(filename="commandlist.json", valuelist=self.commandlist)
def run_process(self, **kwargs):
file = open("profilelist.json", "r")
profilelist = [prof for prof in json.load(file)]
hour = str(kwargs['time'].hours())
period = kwargs['time'].period().replace(".","").upper()
if len(str(kwargs['time'].minutes())) == 1:
minute = f"0{str(kwargs['time'].minutes())}"
else:
minute = str(kwargs['time'].minutes())
formatted_time = f"{hour}:{minute} {period}"
pronum = 0
for command in self.commandlist:
if kwargs['rotate'].get()=="No":
profile = kwargs['profile'].get().split("|")[0].strip()
else:
# rotating profile account
profile = None
while profile==None:
if pronum == len(profilelist):
pronum = 0
for i in range(pronum, len(profilelist)):
if profilelist[i]['payment_method_id'] != None:
profile = profilelist[i]['profilename']
break
pronum += 1
pronum += 1
# print(profile)
run_module(comlist=[PYLOC, "modules/resybotv4.py", "-u", '{}'.format(command['baseurl']), "-d", '{}'.format(command['date']), "-t", '{}'.format(command['time']), "-s", '{}'.format(command['seats']), "-r", '{}'.format(command['reservation_type']), "-cp", profile, "-rd", '{}'.format(kwargs['date'].get_date()), "-rt", formatted_time])
class ListCommandV4bFrame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
file = open("commandlist.json", "r")
self.commandlist = json.load(file)
commandlist = ["{} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {}".format(str(value['baseurl']).split("/")[-1], value['date'], value['time'], value['range_hours'], value['seats'], value['reservation_type'], value['email'], value["run_date"], value['run_time'], value['runnow'], value['nonstop'], value['duration'], value['proxy'] ) for value in self.commandlist]
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
titleLabel = TitleLabel(self, text="List Bot's Command")
dlist = StringVar(value=commandlist)
self.valueslist = Listbox(self, width=140, height=10, listvariable=dlist, selectmode="multiple")
closeButton = CloseButton(self)
runButton = ttk.Button(self, text='Run Process', command = lambda:self.run_process())
removeButton = ttk.Button(self, text='Remove', command = lambda:self.removeSelection())
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S))
self.valueslist.grid(column = 0, row = 1, sticky=(W))
runButton.grid(column = 0, row = 2, sticky = (E))
removeButton.grid(column = 0, row = 2, sticky = (W))
closeButton.grid(column = 0, row = 3, sticky = (E))
def removeSelection(self):
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
selection = self.valueslist.curselection()
# breakpoint()
for i in selection[::-1]:
text = self.valueslist.get(i)
self.valueslist.delete(i)
for idx, dl in enumerate(self.commandlist):
if "{} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {}".format(str(dl['baseurl']).split("/")[-1], dl['date'], dl['time'], dl['range_hours'], dl['seats'], dl['reservation_type'], dl['email'], dl["run_date"], dl['run_time'], dl['runnow'], dl['nonstop'], dl['duration'], dl['proxy']) == text:
self.commandlist.remove(dl)
break
savejson(filename="commandlist.json", valuelist=self.commandlist)
def run_process(self, **kwargs):
fileprofile = open("profilelist.json", "r")
profilelist = [prof for prof in json.load(fileprofile)]
selection = self.valueslist.curselection()
for i in selection:
text = self.valueslist.get(i)
for dl in self.commandlist:
if "{} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {} | {}".format(str(dl['baseurl']).split("/")[-1], dl['date'], dl['time'], dl['range_hours'], dl['seats'], dl['reservation_type'], dl['email'], dl["run_date"], dl['run_time'], dl['runnow'], dl['nonstop'], dl['duration'], dl['proxy']) == text:
for prof in profilelist:
if prof['email']==dl['email']:
profselected = prof['profilename']
break
run_module(comlist=[PYLOC, "modules/resybotv4b.py", "-u", '{}'.format(dl['baseurl']), "-d", '{}'.format(dl['date']), "-t", '{}'.format(dl['time']), "-s", '{}'.format(dl['seats']), "-r", '{}'.format(dl['reservation_type']), "-cp", profselected, "-rd", '{}'.format(dl['run_date']), "-rt", dl['run_time'], "-rh", '{}'.format(dl['range_hours']), "-rn", '{}'.format(dl['runnow']), "-ns", '{}'.format(dl['nonstop']), "-dr", '{}'.format(dl['duration']), "-up", '{}'.format(dl['proxy'])])
class ResyBotv5Frame(ttk.Frame):
def __init__(self, window) -> None:
super().__init__(window)
# configure
self.grid(column=0, row=0, sticky=(N, E, W, S), columnspan=4)
self.config(padding="20 20 20 20", borderwidth=1, relief='groove')
self.chosenRow = None
self.columnconfigure(0, weight=1)
self.columnconfigure(1, weight=1)
self.columnconfigure(2, weight=1)
self.rowconfigure(0, weight=1)
self.rowconfigure(1, weight=1)
self.rowconfigure(2, weight=1)
self.rowconfigure(3, weight=1)
self.rowconfigure(4, weight=1)
self.rowconfigure(5, weight=1)
self.rowconfigure(6, weight=1)
self.rowconfigure(7, weight=1)
self.rowconfigure(8, weight=1)
self.rowconfigure(9, weight=1)
self.rowconfigure(10, weight=1)
# populate
titleLabel = TitleLabel(self, text="Resy Bot Form")
urllabel = Label(self, text="Base URL: ")
datelabel = Label(self, text="Date: ")
timelabel = Label(self, text="Time: ")
rangelabel = Label(self, text="hours before & after: ")
seatslabel = Label(self, text="Seats: ")
reservationlabel = Label(self, text="Reservation Type: ")
chprofilelabel = Label(self, text="Account: ")
runimlabel = Label(self, text="Run Immediately: ")
rundatelabel = Label(self, text="Run Date: ")
runtimelabel = Label(self, text="Run Time: ")
nstoplabel = Label(self, text="Nonstop Checking: ")
durationlabel = Label(self, text="Duration in Minutes: ")
proxylabel = Label(self, text="Proxy: ")
self.url = StringVar(value="https://resy.com/cities/orlando-fl/venues/kabooki-sushi-east-colonial")
urlentry = Entry(self, width=80, textvariable=self.url)
self.date = StringVar()
dateentry = DateEntry(self, width= 20, date_pattern='yyyy-mm-dd', textvariable=self.date)
self.time = StringVar()
self.timeentry = SpinTimePickerOld(self)
self.timeentry.addHours12()
self.timeentry.addMinutes()
self.timeentry.addPeriod()
self.defseat = StringVar(value=2)
seatsentry = Spinbox(self, from_=1, to=100, textvariable=self.defseat, state="readonly", width=5)
seatsentry.insert(0,2)
self.defrange = StringVar(value=0)
rangeentry = Spinbox(self, from_=0, to=100, textvariable=self.defrange, state="readonly", width=5)
# rangeentry.insert(0,0)
self.reservation = StringVar()
reservationentry = ttk.Combobox(self, textvariable=self.reservation, state="readonly", width=30)
reservationentry['values'] = db.reservationValues()
reservationentry.current(0)
self.profile=StringVar()
chprofileentry = ttk.Combobox(self, textvariable=self.profile, state="readonly", width=30)
chprofileentry['values'] = db.profileValues()
chprofileentry.current(0)
self.rundate = StringVar()
rundateentry = DateEntry(self, width= 20, date_pattern='yyyy-mm-dd', textvariable=self.rundate)
self.runtimeentry = SpinTimePickerOld(self)
self.runtimeentry.addHours12()
self.runtimeentry.addMinutes()
self.runtimeentry.addSeconds()
self.runtimeentry.addPeriod()
self.runim = StringVar()
runimentry = ttk.Combobox(self, textvariable=self.runim, state="readonly", width=5)
runimentry['values'] = ['No','Yes']
runimentry.current(0)
self.nstop=StringVar()
nstopentry = ttk.Combobox(self, textvariable=self.nstop, state="readonly", width=5)
nstopentry['values'] = ['No','Yes']
nstopentry.current(0)
self.duration = StringVar(value=0)
durationentry = Spinbox(self, from_=0, to=600, textvariable=self.duration, width=5)
self.proxy=StringVar()
proxyentry = ttk.Combobox(self, textvariable=self.proxy, state="readonly", width=30)
proxyentry['values'] = db.proxyValues()
proxyentry.current(0)
style = ttk.Style()
# style.theme_use("clam")
style.configure("Fancy.TButton", font=("Cooper Black", 12), foreground="blue", background="green")
closeButton = CloseButton(self)
saveButton = ttk.Button(self, text='Insert Booking', command = lambda:self.savelist(url=urlentry, date=dateentry, time=self.timeentry, seats=seatsentry, reservation=reservationentry, profile=chprofileentry, range_hours=rangeentry, run_date=rundateentry, run_time=self.runtimeentry, runnow=runimentry, nonstop=nstopentry, duration=durationentry, proxy=proxyentry), style="Fancy.TButton")
runButton = ttk.Button(self, text='Run Booking', command=self.runCommand, style="Fancy.TButton")
removeButton = ttk.Button(self, text='Delete Booking', command=self.removeCommand, style="Fancy.TButton")
updateButton = ttk.Button(self, text='Update Booking', command=self.updateCommand, style="Fancy.TButton")
# layout
titleLabel.grid(column = 0, row = 0, sticky = (W, E, N, S), columnspan=3)
urllabel.grid(column = 0, row = 1, sticky=(W))
urlentry.grid(column = 0, row = 1, sticky=(E))
datelabel.grid(column = 0, row = 2, sticky=(W))
dateentry.grid(column = 0, row = 2, sticky=(E))
timelabel.grid(column = 0, row = 3, sticky=(W))
self.timeentry.grid(column = 0, row = 3, sticky=(E))
rangelabel.grid(column = 0, row = 4, sticky=(W))
rangeentry.grid(column = 0, row = 4, sticky=(E))
seatslabel.grid(column = 0, row = 5, sticky=(W))
seatsentry.grid(column = 0, row = 5, sticky=(E))
reservationlabel.grid(column = 0, row = 6, sticky=(W))
reservationentry.grid(column = 0, row = 6, sticky=(E))
rundatelabel.grid(column = 2, row = 1, sticky=(W))
rundateentry.grid(column = 2, row = 1, sticky=(E))
runtimelabel.grid(column = 2, row = 2, sticky=(W))
self.runtimeentry.grid(column = 2, row = 2, sticky=(E))
runimlabel.grid(column = 2, row = 3, sticky=(W))
runimentry.grid(column = 2, row = 3, sticky=(E))
chprofilelabel.grid(column = 2, row = 4, sticky=(W))
chprofileentry.grid(column = 2, row = 4, sticky=(E))
nstoplabel.grid(column = 2, row = 5, sticky=(W))
nstopentry.grid(column = 2, row = 5, sticky=(E))
durationlabel.grid(column = 2, row = 6, sticky=(W))
durationentry.grid(column = 2, row = 6, sticky=(E))
proxylabel.grid(column = 2, row = 7, sticky=(W))
proxyentry.grid(column = 2, row = 7, sticky=(E))
# viewButton.grid(column=2, row=8, sticky=(W))
saveButton.grid(column = 2, row = 8, sticky = (E))
runButton.grid(column = 0, row = 8, sticky = (W))
updateButton.grid(column = 2, row = 8, sticky = (W))
removeButton.grid(column = 0, row = 8, sticky = (E))
closeButton.grid(column = 2, row = 10, sticky = (E))
self.tableOutputFrame()
self.viewCommand()
self.resetForm()
def savelist(self, **kwargs):
formatted_time = convert24time(kwargs['time'])
formatted_runtime = convert24timeSecond(kwargs['run_time'])
db.insertCommand(url=kwargs['url'].get(), datewanted=str(kwargs['date'].get_date()), timewanted=formatted_time, seats=kwargs['seats'].get(), reservation=kwargs['reservation'].get(), account=kwargs['profile'].get(), hoursba=kwargs['range_hours'].get(), rundate=str(kwargs['run_date'].get_date()), runtime=formatted_runtime, runnow=kwargs['runnow'].get(), nonstop=kwargs['nonstop'].get(), duration=kwargs['duration'].get(), proxy=kwargs['proxy'].get())
# savejson(filename="commandlist.json", valuelist=self.commandlist)
self.viewCommand()
messagebox.showinfo("Message box","Booking list Saved")
self.resetForm()
def viewCommand(self):
self.out.delete(*self.out.get_children()) # emptying the table before reloading
for row in db.viewCommand():
self.out.insert("", END, values=row)
def runCommand(self):
selection = self.out.selection()
if len(selection) == 0:
messagebox.showerror("Error!", "Please Choose a Bot Command Record to Run!")
return
try:
for i in selection:
item = self.out.item(i)['values']
run_module(comlist=[PYLOC, "modules/resybotv5.py", "-u", '{}'.format(item[14]), "-d", '{}'.format(item[2]), "-t", '{}'.format(item[3]), "-s", '{}'.format(item[5]), "-r", '{}'.format(item[6]), "-cp", item[10], "-rd", '{}'.format(item[7]), "-rt", item[8], "-rh", '{}'.format(item[4]), "-rn", '{}'.format(item[9]), "-ns", '{}'.format(item[11]), "-dr", '{}'.format(item[12]), "-up", '{}'.format(item[13])])
except AttributeError as error:
messagebox.showerror("Error!", "Please Choose a Bot Command Record to Run!")
def removeCommand(self):
selection = self.out.selection()
if len(selection) == 0:
messagebox.showerror("Error!", "Please Choose a Bot Command Record to Delete!")
return
if not messagebox.askyesno(title='confirmation',message='Do you want to remove it?'):
return
try:
for i in selection:
item = self.out.item(i)['values']
db.removeCommand(item[0])
self.resetForm()
self.viewCommand()
except AttributeError as error:
messagebox.showerror("Error!", "Please Choose a Bot Command Record to Remove!")