forked from Fluorite-Apps/Fluorite-Store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
1846 lines (1482 loc) · 88.4 KB
/
main.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
import sys
import os
from ui_scoopgui import *
from PySide6.QtGui import *
import subprocess
import re
from PySide6 import QtCore, QtWidgets, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
POWERSHELL_PATH = "C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QLabel, QMainWindow, QPushButton,
QSizePolicy, QStatusBar, QWidget, QMessageBox, QComboBox)
from state_tooltip import StateTooltip
from threading import Thread
import time
from os.path import exists
from py_toggle import *
from Second_PushButton import *
from BlurWindow.blurWindow import blur
from BlurWindow.blurWindow import GlobalBlur
import resource_file_qt_rc
import plyer
from plyer import *
import webbrowser
from plyer import notification
import subprocess
from os.path import exists
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self, parent=None , *args, obj=None, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs, parent=parent)
self.setupUi(self)
self.setAttribute(Qt.WA_TranslucentBackground)
self.resize(1150, 700)
GlobalBlur(self.winId(),Dark=True,QWidget=self)
self.setStyleSheet("background-color: rgba(0, 0, 0, 0)")
# self.setAttribute(Qt.WA_TranslucentBackground)
# self.resize(1050, 700)
#
# hWnd = self.winId()
# print(hWnd)
# blur(hWnd)
# self.setStyleSheet("background-color: rgba(0, 0, 0, 0)")
# loading splashscreen
# self.stackedWidget.setCurrentWidget(self.splashscreen)
# making widget and adding to layout
self.go_recommended_apps_page_button = custompushbutton('Starred', parent=self)
self.go_recommended_apps_page_button.setMinimumHeight(91)
self.go_recommended_apps_page_button.setFixedWidth(251)
self.enter_recommended_apps_frame.addWidget(self.go_recommended_apps_page_button, Qt.AlignCenter, Qt.AlignCenter)
# attaching to function
self.go_recommended_apps_page_button.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_1))
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# UPDATING SCOOP REPO WHEN LAUNCHING #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
def do_update_and_show_status():
#update scoop repo
powershell_do_update = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', "scoop update"]
powershell_do_update_1 = subprocess.run(powershell_do_update, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
powershell_do_update2 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', "scoop status"]
powershell_do_update_2 = subprocess.run(powershell_do_update2, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
status_output = powershell_do_update_2.stdout
# check number of updates
# does scoop status, counts lines and minuses 6 (non app lines)
number = len(status_output.splitlines())
number = number - 6
if number == 0:
notification.notify(
title='Scoop is up to date',
message="All apps up to date, no need to update",
app_icon="fluorite.ico",
timeout=10,
)
else:
number = str(number)
message = (number+" out of date apps found, please update")
message = str(message)
notification.notify(
title='Out of date apps',
message=message,
app_icon="fluorite.ico",
timeout=10,
)
t = Thread(target=do_update_and_show_status)
t.daemon = True
t.start()
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# INSTALL SCOOP-SEARCH IF NOT ALREADY #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
def check_if_scoop_search_installed():
if exists('fluorite_store_config.txt') == False:
notification.notify(
title='Installing one dependency please wait',
message='getting the scoop-search package from scoop',
app_icon="fluorite.ico",
timeout=10,
)
install_scoop_search_command = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', "scoop install scoop-search"]
install_scoop_search = subprocess.run(install_scoop_search_command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
with open("fluorite_store_config", 'w') as file:
file.write("")
file.close()
notification.notify(
title='Finished',
message='installed scoop-search dependency',
app_icon="fluorite.ico",
timeout=10,
)
t2 = Thread(target=check_if_scoop_search_installed)
t2.daemon = True
t2.start()
def do_search():
def clear_previous_description():
self.app_desc_1_lbl.setText(" ")
self.app_desc_2_lbl.setText(" ")
self.app_desc_3_lbl.setText(" ")
self.app_desc_4_lbl.setText(" ")
self.app_desc_5_lbl.setText(" ")
self.app_label_1.setText(" ")
self.app_label_2.setText(" ")
self.app_label_3.setText(" ")
self.app_label_4.setText(" ")
self.app_label_5.setText(" ")
self.install_search_app_btn_1.setText(" ")
self.install_search_app_btn_2.setText(" ")
self.install_search_app_btn_3.setText(" ")
self.install_search_app_btn_4.setText(" ")
self.install_search_app_btn_5.setText(" ")
t = Thread(target=clear_previous_description)
t.daemon = True
t.start()
# as this part is rather slow, there'll be one function for each app
def app_desc_1_function():
try:
# making scoop cat commands
scoop_cat_command_1 = ("scoop cat "+final_app_one)
powershell_cat_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_cat_command_1)]
powershell_do_cat_1 = subprocess.run(powershell_cat_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
except:
pass
try:
# getting app description from the scoop cat commands
getting_stdout_1 = powershell_do_cat_1.stdout
splitting_stdout_1 = getting_stdout_1.split('\n')
app_desc_1 = splitting_stdout_1[2]
# since desc is sometimes 3 instead of 2, so this check is done
if 'version":' in app_desc_1:
app_desc_1 = splitting_stdout_1[3]
app_desc_1 = app_desc_1.strip(" ")
app_desc_1 = app_desc_1.strip('",')
app_desc_1 = app_desc_1.strip('description": ')
except:
pass
if successful_1:
self.install_search_app_btn_1.setText("install")
# putting app description onto qt description box
try:
self.app_desc_1_lbl.setText(str(app_desc_1))
self.app_label_1.setText(str(final_app_one))
except:
pass
def app_desc_2_function():
try:
scoop_cat_command_2 = ("scoop cat "+final_app_two)
powershell_cat_2 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_cat_command_2)]
powershell_do_cat_2 = subprocess.run(powershell_cat_2, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
except:
pass
try:
getting_stdout_2 = powershell_do_cat_2.stdout
splitting_stdout_2 = getting_stdout_2.split('\n')
app_desc_2 = splitting_stdout_2[2]
if 'version":' in app_desc_2:
app_desc_2 = splitting_stdout_2[3]
app_desc_2 = app_desc_2.strip(" ")
app_desc_2 = app_desc_2.strip('",')
app_desc_2 = app_desc_2.strip('description": ')
except:
pass
if successful_2:
self.install_search_app_btn_2.setText("install")
try:
self.app_desc_2_lbl.setText(str(app_desc_2))
self.app_label_2.setText(str(final_app_two))
except:
pass
def app_desc_3_function():
try:
scoop_cat_command_3 = ("scoop cat "+final_app_three)
powershell_cat_3 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_cat_command_3)]
powershell_do_cat_3 = subprocess.run(powershell_cat_3, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
except:
pass
try:
getting_stdout_3 = powershell_do_cat_3.stdout
splitting_stdout_3 = getting_stdout_3.split('\n')
app_desc_3 = splitting_stdout_3[2]
if 'version":' in app_desc_3:
app_desc_3 = splitting_stdout_3[3]
app_desc_3 = app_desc_3.strip(" ")
app_desc_3 = app_desc_3.strip('",')
app_desc_3 = app_desc_3.strip('description": ')
except:
pass
if successful_3:
self.install_search_app_btn_3.setText("install")
try:
self.app_desc_3_lbl.setText(str(app_desc_3))
self.app_label_3.setText(str(final_app_three))
except:
pass
def app_desc_4_function():
try:
scoop_cat_command_4 = ("scoop cat "+final_app_four)
powershell_cat_4 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_cat_command_4)]
powershell_do_cat_4 = subprocess.run(powershell_cat_4, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
except:
pass
try:
getting_stdout_4 = powershell_do_cat_4.stdout
splitting_stdout_4 = getting_stdout_4.split('\n')
app_desc_4 = splitting_stdout_4[2]
if 'version":' in app_desc_4:
app_desc_4 = splitting_stdout_4[3]
app_desc_4 = app_desc_4.strip(" ")
app_desc_4 = app_desc_4.strip('",')
app_desc_4 = app_desc_4.strip('description": ')
except:
pass
if successful_4:
self.install_search_app_btn_4.setText("install")
try:
self.app_desc_4_lbl.setText(str(app_desc_4))
self.app_label_4.setText(str(final_app_four))
except:
pass
def app_desc_5_function():
try:
scoop_cat_command_5 = ("scoop cat "+final_app_five)
powershell_cat_5 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_cat_command_5)]
powershell_do_cat_5 = subprocess.run(powershell_cat_5, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
except:
pass
try:
getting_stdout_5 = powershell_do_cat_5.stdout
splitting_stdout_5 = getting_stdout_5.split('\n')
app_desc_5 = splitting_stdout_5[2]
if 'version":' in app_desc_5:
app_desc_5 = splitting_stdout_5[3]
app_desc_5 = app_desc_5.strip(" ")
app_desc_5 = app_desc_5.strip('",')
app_desc_5 = app_desc_5.strip('description": ')
except:
pass
if successful_5:
self.install_search_app_btn_5.setText("install")
try:
self.app_desc_5_lbl.setText(str(app_desc_5))
self.app_label_5.setText(str(final_app_five))
except:
pass
# setting previous app names to blank, so if the user searches again, it'll remove previous searches
global final_app_one, final_app_two, final_app_three, final_app_four, final_app_five
final_app_one = " "
final_app_two = " "
final_app_three = " "
final_app_four = " "
final_app_five = " "
# getting search bar text
search_bar_text = self.search_bar_input.text()
# making scoop search command
scoop_search_command = ("scoop-search " + str(search_bar_text))
# notification.notify(
# title='Searching...',
# message='please wait',
# app_icon="fluorite.ico",
# timeout=10,)
powershell_scoop_search_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_search_command)]
powershell_scoop_search_2 = subprocess.run(powershell_scoop_search_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
powershell_scoop_search_2 = str(powershell_scoop_search_2)
split_result = powershell_scoop_search_2.split('\\n')
split_result = str(split_result).split(',')
del split_result[0]
del split_result[0]
del split_result[0]
del split_result[0]
del split_result[0]
del split_result[0]
# removing all items which don't contain a bracket
# because apps have a bracket with the version beside em, so this'll remove all non-apps
stringVal = '('
simplified = [x for x in split_result if stringVal in x]
# only keeping the left of the bracket, which is the appname
try:
final_app_one = (simplified[0].split("(")[0]).strip()
final_app_one = final_app_one.strip("'")
final_app_one = final_app_one.strip('"')
final_app_one = final_app_one.strip(" ")
successful_1 = True
except:
# if the try for finding the first app fails, then no apps were found, hence notifying the user
self.app_desc_1_lbl.setText("no apps found")
# then skipping the rest of the function
return None
try:
final_app_two = (simplified[1].split("(")[0]).strip()
final_app_two = final_app_two.strip("'")
final_app_two = final_app_two.strip('"')
final_app_two = final_app_two.strip(" ")
# then adding text to install buttons if app exists for that row
successful_2 = True
except:
successful_2 = False
try:
final_app_three = (simplified[2].split("(")[0]).strip()
final_app_three = final_app_three.strip("'")
final_app_three = final_app_three.strip('"')
final_app_three = final_app_three.strip(" ")
successful_3 = True
except:
successful_3 = False
try:
final_app_four = (simplified[3].split("(")[0]).strip()
final_app_four = final_app_four.strip("'")
final_app_four = final_app_four.strip('"')
final_app_four = final_app_four.strip(" ")
successful_4 = True
except:
successful_4 = False
try:
final_app_five = (simplified[4].split("(")[0]).strip()
final_app_five = final_app_five.strip("'")
final_app_five = final_app_five.strip('"')
final_app_five = final_app_five.strip(" ")
successful_5 = True
except:
successful_5 = False
try:
# making scoop install commands
scoop_install_command_1 = ("scoop install "+final_app_one)
scoop_install_command_2 = ("scoop install "+final_app_two)
scoop_install_command_3 = ("scoop install "+final_app_three)
scoop_install_command_4 = ("scoop install "+final_app_four)
scoop_install_command_5 = ("scoop install "+final_app_five)
except:
pass
# getting app descriptions - to speed this part up as its quite slow, there'll be 5 threads, 1 for getting each app description
t = Thread(target=app_desc_1_function)
t.daemon = True
t.start()
z = Thread(target=app_desc_2_function)
z.daemon = True
z.start()
x = Thread(target=app_desc_3_function)
x.daemon = True
x.start()
y = Thread(target=app_desc_4_function)
y.daemon = True
y.start()
c = Thread(target=app_desc_5_function)
c.daemon = True
c.start()
def installed_app_notif_1():
notification.notify(
title='Finished',
message='Installed app',
app_icon="fluorite.ico",
timeout=10,
)
# installing corresponding apps when install button is pressed
def install_search_app_one():
powershell_install_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_install_command_1)]
powershell_do_install_1 = subprocess.run(powershell_install_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
installed_app_notif_1()
def install_search_app_two():
powershell_install_2 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_install_command_2)]
powershell_do_install_2 = subprocess.run(powershell_install_2, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
installed_app_notif_1()
def install_search_app_three():
powershell_install_3 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_install_command_3)]
powershell_do_install_3 = subprocess.run(powershell_install_3, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
installed_app_notif_1()
def install_search_app_four():
powershell_install_4 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_install_command_4)]
powershell_do_install_4 = subprocess.run(powershell_install_4, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
installed_app_notif_1()
def install_search_app_five():
powershell_install_5 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_install_command_5)]
powershell_do_install_5 = subprocess.run(powershell_install_5, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
installed_app_notif_1()
def install_search_app_one_thread():
t = Thread(target=install_search_app_one)
t.daemon = True
t.start()
def install_search_app_two_thread():
t = Thread(target=install_search_app_two)
t.daemon = True
t.start()
def install_search_app_three_thread():
t = Thread(target=install_search_app_three)
t.daemon = True
t.start()
def install_search_app_four_thread():
t = Thread(target=install_search_app_four)
t.daemon = True
t.start()
def install_search_app_five_thread():
t = Thread(target=install_search_app_five)
t.daemon = True
t.start()
# connecting search page install buttons to install function
self.install_search_app_btn_1.clicked.connect(lambda: install_search_app_one_thread())
self.install_search_app_btn_2.clicked.connect(lambda: install_search_app_two_thread())
self.install_search_app_btn_3.clicked.connect(lambda: install_search_app_three_thread())
self.install_search_app_btn_4.clicked.connect(lambda: install_search_app_four_thread())
self.install_search_app_btn_5.clicked.connect(lambda: install_search_app_five_thread())
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# VIRUS TOTAL APP CHECKING #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
def app_is_safe_notif():
notification.notify(
title='App is Safe',
message='no malware detections found from 58 sources - VirusTotal',
app_icon="fluorite.ico",
timeout=10,
)
def vt_function_1():
vt_command_1 = ("scoop virustotal "+final_app_one)
vt_ps_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (vt_command_1)]
vt_do_ps_1 = subprocess.run(vt_ps_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
vt_output = vt_do_ps_1.stdout
vt_output = vt_output.split(" ")
# checking for WARN word, if it exists then vt returned at least 1 detection and the virustotal link is opened in a browser for the user to check
# else its safe
if vt_output[0] == "WARN":
vt_output_url = vt_output[5]
webbrowser.open(vt_output_url)
else:
app_is_safe_notif()
def vt_function_2():
vt_command_1 = ("scoop virustotal "+final_app_two)
vt_ps_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (vt_command_1)]
vt_do_ps_1 = subprocess.run(vt_ps_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
vt_output = vt_do_ps_1.stdout
vt_output = vt_output.split(" ")
# checking for WARN word, if it exists then vt returned at least 1 detection and the virustotal link is opened in a browser for the user to check
# else its safe
if vt_output[0] == "WARN":
vt_output_url = vt_output[5]
webbrowser.open(vt_output_url)
else:
app_is_safe_notif()
def vt_function_3():
vt_command_1 = ("scoop virustotal "+final_app_three)
vt_ps_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (vt_command_1)]
vt_do_ps_1 = subprocess.run(vt_ps_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
vt_output = vt_do_ps_1.stdout
vt_output = vt_output.split(" ")
# checking for WARN word, if it exists then vt returned at least 1 detection and the virustotal link is opened in a browser for the user to check
# else its safe
if vt_output[0] == "WARN":
vt_output_url = vt_output[5]
webbrowser.open(vt_output_url)
else:
app_is_safe_notif()
def vt_function_4():
vt_command_1 = ("scoop virustotal "+final_app_four)
vt_ps_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (vt_command_1)]
vt_do_ps_1 = subprocess.run(vt_ps_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
vt_output = vt_do_ps_1.stdout
vt_output = vt_output.split(" ")
# checking for WARN word, if it exists then vt returned at least 1 detection and the virustotal link is opened in a browser for the user to check
# else its safe
if vt_output[0] == "WARN":
vt_output_url = vt_output[5]
webbrowser.open(vt_output_url)
else:
app_is_safe_notif()
def vt_function_5():
vt_command_1 = ("scoop virustotal "+final_app_five)
vt_ps_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (vt_command_1)]
vt_do_ps_1 = subprocess.run(vt_ps_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
vt_output = vt_do_ps_1.stdout
vt_output = vt_output.split(" ")
# checking for WARN word, if it exists then vt returned at least 1 detection and the virustotal link is opened in a browser for the user to check
# else its safe
if vt_output[0] == "WARN":
vt_output_url = vt_output[5]
webbrowser.open(vt_output_url)
else:
app_is_safe_notif()
def remove_app_function():
remove_app_input_text = self.apps_list.currentText()
# making scoop remove command
scoop_remove_command = ("scoop uninstall " + str(remove_app_input_text))
powershell_scoop_remove_1 = [POWERSHELL_PATH, '-ExecutionPolicy', 'Unrestricted', (scoop_remove_command)]
powershell_scoop_remove_2 = subprocess.run(powershell_scoop_remove_1, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, shell="False")
notification.notify(
title='Finished',
message='uninstalled app',
app_icon="fluorite.ico",
timeout=10,
)
def remove_app_function_thread():
t = Thread(target=remove_app_function)
t.daemon = True
t.start()
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# INSTALL BUTTONS ON SEARCH PAGE #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# making search page install buttons and adding to layout
self.install_search_app_btn_1 = custompushbutton('install', parent=self)
self.install_search_app_btn_1.setMinimumHeight(51)
self.install_search_app_btn_1.setFixedWidth(101)
self.install_search_app_btn_2 = custompushbutton('install', parent=self)
self.install_search_app_btn_2.setMinimumHeight(51)
self.install_search_app_btn_2.setFixedWidth(101)
self.install_search_app_btn_3 = custompushbutton('install', parent=self)
self.install_search_app_btn_3.setMinimumHeight(51)
self.install_search_app_btn_3.setFixedWidth(101)
self.install_search_app_btn_4 = custompushbutton('install', parent=self)
self.install_search_app_btn_4.setMinimumHeight(51)
self.install_search_app_btn_4.setFixedWidth(101)
self.install_search_app_btn_5 = custompushbutton('install', parent=self)
self.install_search_app_btn_5.setMinimumHeight(51)
self.install_search_app_btn_5.setFixedWidth(101)
self.app_install_1_layout.addWidget(self.install_search_app_btn_1, Qt.AlignCenter, Qt.AlignCenter)
self.app_install_2_layout.addWidget(self.install_search_app_btn_2, Qt.AlignCenter, Qt.AlignCenter)
self.app_install_3_layout.addWidget(self.install_search_app_btn_3, Qt.AlignCenter, Qt.AlignCenter)
self.app_install_4_layout.addWidget(self.install_search_app_btn_4, Qt.AlignCenter, Qt.AlignCenter)
self.app_install_5_layout.addWidget(self.install_search_app_btn_5, Qt.AlignCenter, Qt.AlignCenter)
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# REMOVE APP AND INPUT BOX #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.remove_app_button = custompushbutton('Remove App (click)', parent=self)
self.remove_app_button.setMinimumHeight(61)
self.remove_app_button.setFixedWidth(131)
self.remove_app_button_layout.addWidget(self.remove_app_button, Qt.AlignCenter, Qt.AlignCenter)
self.remove_app_button.clicked.connect(lambda: remove_app_function_thread())
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# SEARCH BAR & SEARCH BUTTON #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.enter_search_term_button = custompushbutton('Enter', parent=self)
self.enter_search_term_button.setMinimumHeight(51)
self.enter_search_term_button.setFixedWidth(91)
self.enter_search_term_layout.addWidget(self.enter_search_term_button, Qt.AlignCenter, Qt.AlignCenter)
self.enter_search_term_button.clicked.connect(lambda: threaded_do_search())
self.search_bar_input.returnPressed.connect(lambda: threaded_do_search())
def threaded_do_search():
t = Thread(target=do_search)
t.daemon = True
t.start()
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# STATUS INDICATOR #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.status_indicator_1 = QLabel("", parent=self)
self.status_indicator_2 = QLabel("", parent=self)
self.status_indicator_3 = QLabel("", parent=self)
self.status_indicator_4 = QLabel("", parent=self)
self.status_indicator_5 = QLabel("", parent=self)
self.status_indicator_6 = QLabel("", parent=self)
# bucket add or remove status indicator
self.status_indicator_bucket= QLabel("", parent=self)
self.status_indicator_layout_1.addWidget(self.status_indicator_1, Qt.AlignCenter, Qt.AlignCenter)
self.status_indicator_layout_2.addWidget(self.status_indicator_2, Qt.AlignCenter, Qt.AlignCenter)
self.status_indicator_layout_3.addWidget(self.status_indicator_3, Qt.AlignCenter, Qt.AlignCenter)
self.status_indicator_layout_4.addWidget(self.status_indicator_4, Qt.AlignCenter, Qt.AlignCenter)
self.status_indicator_layout_5.addWidget(self.status_indicator_5, Qt.AlignCenter, Qt.AlignCenter)
self.status_indicator_layout_6.addWidget(self.status_indicator_6, Qt.AlignCenter, Qt.AlignCenter)
self.status_indicator_layout_buckets.addWidget(self.status_indicator_bucket, Qt.AlignCenter, Qt.AlignCenter)
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# NEXT PAGE BUTTON - STARRED/RECOMMENDED APPS PAGE #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# defining the button
self.starred_next_page_1 = custompushbutton('N\ne\nx\nt\n\nP\na\ng\ne', parent=self)
self.starred_next_page_1.setMinimumHeight(241)
self.starred_next_page_1.setFixedWidth(51)
self.starred_next_page_2 = custompushbutton('N\ne\nx\nt\n\nP\na\ng\ne', parent=self)
self.starred_next_page_2.setMinimumHeight(241)
self.starred_next_page_2.setFixedWidth(51)
self.starred_next_page_3 = custompushbutton('N\ne\nx\nt\n\nP\na\ng\ne', parent=self)
self.starred_next_page_3.setMinimumHeight(241)
self.starred_next_page_3.setFixedWidth(51)
self.starred_next_page_4 = custompushbutton('N\ne\nx\nt\n\nP\na\ng\ne', parent=self)
self.starred_next_page_4.setMinimumHeight(241)
self.starred_next_page_4.setFixedWidth(51)
self.starred_next_page_5 = custompushbutton('N\ne\nx\nt\n\nP\na\ng\ne', parent=self)
self.starred_next_page_5.setMinimumHeight(241)
self.starred_next_page_5.setFixedWidth(51)
# Adding back button to layout
self.recc_next_page_layout_1.addWidget(self.starred_next_page_1, Qt.AlignCenter, Qt.AlignCenter)
self.recc_next_page_layout_two.addWidget(self.starred_next_page_2, Qt.AlignCenter, Qt.AlignCenter)
self.recc_next_page_layout_3.addWidget(self.starred_next_page_3, Qt.AlignCenter, Qt.AlignCenter)
self.recc_next_page_layout_4.addWidget(self.starred_next_page_4, Qt.AlignCenter, Qt.AlignCenter)
self.recc_next_page_layout_5.addWidget(self.starred_next_page_5, Qt.AlignCenter, Qt.AlignCenter)
# connecting back button to function
self.starred_next_page_1.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_2))
self.starred_next_page_2.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_3))
self.starred_next_page_3.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_4))
self.starred_next_page_4.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_5))
self.starred_next_page_5.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_6))
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# BACK BUTTON - RETURNING TO HOMEPAGE #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# defining the button
self.return_home = custompushbutton('Back', parent=self)
self.return_home.setMinimumHeight(61)
self.return_home.setFixedWidth(261)
self.return_home_1 = custompushbutton('H\no\nm\ne', parent=self)
self.return_home_1.setMinimumHeight(181)
self.return_home_1.setFixedWidth(51)
self.return_home_2 = custompushbutton('B\na\nc\nk', parent=self)
self.return_home_2.setMinimumHeight(181)
self.return_home_2.setFixedWidth(51)
self.return_home_3 = custompushbutton('B\na\nc\nk', parent=self)
self.return_home_3.setMinimumHeight(181)
self.return_home_3.setFixedWidth(51)
self.return_home_4 = custompushbutton('B\na\nc\nk', parent=self)
self.return_home_4.setMinimumHeight(181)
self.return_home_4.setFixedWidth(51)
self.return_home_5 = custompushbutton('B\na\nc\nk', parent=self)
self.return_home_5.setMinimumHeight(181)
self.return_home_5.setFixedWidth(51)
self.return_home_6 = custompushbutton('B\na\nc\nk', parent=self)
self.return_home_6.setMinimumHeight(181)
self.return_home_6.setFixedWidth(51)
self.return_home_7 = custompushbutton('Back', parent=self)
self.return_home_7.setMinimumHeight(61)
self.return_home_7.setFixedWidth(261)
# return home page button on search page#
self.back_search_page = custompushbutton('Home', parent=self)
self.back_search_page.setMinimumHeight(51)
self.back_search_page.setFixedWidth(131)
# Adding back button to layout
self.bucket_back_layout.addWidget(self.return_home, Qt.AlignCenter, Qt.AlignCenter)
self.return_home_layout_settings.addWidget(self.return_home, Qt.AlignCenter, Qt.AlignCenter)
self.back_search_page_layout.addWidget(self.back_search_page, Qt.AlignCenter, Qt.AlignCenter)
self.return_home_layout_1.addWidget(self.return_home_1, Qt.AlignCenter, Qt.AlignCenter)
self.return_home_layout_two.addWidget(self.return_home_2, Qt.AlignCenter, Qt.AlignCenter)
self.return_home_layout_3.addWidget(self.return_home_3, Qt.AlignCenter, Qt.AlignCenter)
self.return_home_layout_4.addWidget(self.return_home_4, Qt.AlignCenter, Qt.AlignCenter)
self.return_home_layout_5.addWidget(self.return_home_5, Qt.AlignCenter, Qt.AlignCenter)
self.return_home_layout_6.addWidget(self.return_home_6, Qt.AlignCenter, Qt.AlignCenter)
self.bucket_back_layout.addWidget(self.return_home_7, Qt.AlignCenter, Qt.AlignCenter)
# connecting back button to function
self.return_home.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.home))
self.back_search_page.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.home))
self.return_home_1.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.home))
self.return_home_2.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_1))
self.return_home_3.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_2))
self.return_home_4.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_3))
self.return_home_5.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_4))
self.return_home_6.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.recommended_apps_page_5))
self.return_home_7.clicked.connect(lambda: self.stackedWidget.setCurrentWidget(self.home))
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# DESCRIPTION LABELS ON SEARCH APPS PAGE #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.app_desc_1_lbl = QLabel("", parent=self)
self.app_desc_2_lbl = QLabel("", parent=self)
self.app_desc_3_lbl = QLabel("", parent=self)
self.app_desc_4_lbl = QLabel("", parent=self)
self.app_desc_5_lbl = QLabel("", parent=self)
self.app_desc_1_layout.addWidget(self.app_desc_1_lbl, Qt.AlignCenter, Qt.AlignCenter)
self.app_desc_2_layout.addWidget(self.app_desc_2_lbl, Qt.AlignCenter, Qt.AlignCenter)
self.app_desc_3_layout.addWidget(self.app_desc_3_lbl, Qt.AlignCenter, Qt.AlignCenter)
self.app_desc_4_layout.addWidget(self.app_desc_4_lbl, Qt.AlignCenter, Qt.AlignCenter)
self.app_desc_5_layout.addWidget(self.app_desc_5_lbl, Qt.AlignCenter, Qt.AlignCenter)
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# INSTALL BUTTONS PAGE 1 - STARRED APPS #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.recc_app_install_button_1 = custompushbutton('Install', parent=self)
self.recc_app_install_button_1.setMinimumHeight(71)
self.recc_app_install_button_1.setFixedWidth(131)
self.recc_app_install_button_2 = custompushbutton('Install', parent=self)
self.recc_app_install_button_2.setMinimumHeight(71)
self.recc_app_install_button_2.setFixedWidth(131)
self.recc_app_install_button_3 = custompushbutton('Install', parent=self)
self.recc_app_install_button_3.setMinimumHeight(71)
self.recc_app_install_button_3.setFixedWidth(131)
self.recc_app_install_button_4 = custompushbutton('Install', parent=self)
self.recc_app_install_button_4.setMinimumHeight(71)
self.recc_app_install_button_4.setFixedWidth(131)
self.recc_app_install_button_5 = custompushbutton('Install', parent=self)
self.recc_app_install_button_5.setMinimumHeight(71)
self.recc_app_install_button_5.setFixedWidth(131)
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# INSTALL BUTTONS PAGE 2 - STARRED APPS #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.recc_app_install_button_6 = custompushbutton('Install', parent=self)
self.recc_app_install_button_6.setMinimumHeight(71)
self.recc_app_install_button_6.setFixedWidth(131)
self.recc_app_install_button_7 = custompushbutton('Install', parent=self)
self.recc_app_install_button_7.setMinimumHeight(71)
self.recc_app_install_button_7.setFixedWidth(131)
self.recc_app_install_button_8 = custompushbutton('Install', parent=self)
self.recc_app_install_button_8.setMinimumHeight(71)
self.recc_app_install_button_8.setFixedWidth(131)
self.recc_app_install_button_9 = custompushbutton('Install', parent=self)
self.recc_app_install_button_9.setMinimumHeight(71)
self.recc_app_install_button_9.setFixedWidth(131)
self.recc_app_install_button_10 = custompushbutton('Install', parent=self)
self.recc_app_install_button_10.setMinimumHeight(71)
self.recc_app_install_button_10.setFixedWidth(131)
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# INSTALL BUTTONS PAGE 3 - STARRED APPS #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.recc_app_install_button_11 = custompushbutton('Install', parent=self)
self.recc_app_install_button_11.setMinimumHeight(71)
self.recc_app_install_button_11.setFixedWidth(131)
self.recc_app_install_button_12 = custompushbutton('Install', parent=self)
self.recc_app_install_button_12.setMinimumHeight(71)
self.recc_app_install_button_12.setFixedWidth(131)
self.recc_app_install_button_13 = custompushbutton('Install', parent=self)
self.recc_app_install_button_13.setMinimumHeight(71)
self.recc_app_install_button_13.setFixedWidth(131)
self.recc_app_install_button_14 = custompushbutton('Install', parent=self)
self.recc_app_install_button_14.setMinimumHeight(71)
self.recc_app_install_button_14.setFixedWidth(131)
self.recc_app_install_button_15 = custompushbutton('Install', parent=self)
self.recc_app_install_button_15.setMinimumHeight(71)
self.recc_app_install_button_15.setFixedWidth(131)
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# INSTALL BUTTONS PAGE 4 - STARRED APPS #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.recc_app_install_button_16 = custompushbutton('Install', parent=self)
self.recc_app_install_button_16.setMinimumHeight(71)
self.recc_app_install_button_16.setFixedWidth(131)
self.recc_app_install_button_17 = custompushbutton('Install', parent=self)
self.recc_app_install_button_17.setMinimumHeight(71)
self.recc_app_install_button_17.setFixedWidth(131)
self.recc_app_install_button_18 = custompushbutton('Install', parent=self)
self.recc_app_install_button_18.setMinimumHeight(71)
self.recc_app_install_button_18.setFixedWidth(131)
self.recc_app_install_button_19 = custompushbutton('Install', parent=self)
self.recc_app_install_button_19.setMinimumHeight(71)
self.recc_app_install_button_19.setFixedWidth(131)
self.recc_app_install_button_20 = custompushbutton('Install', parent=self)
self.recc_app_install_button_20.setMinimumHeight(71)
self.recc_app_install_button_20.setFixedWidth(131)
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
# INSTALL BUTTONS PAGE 5 - STARRED APPS #
# \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
self.recc_app_install_button_21 = custompushbutton('Install', parent=self)
self.recc_app_install_button_21.setMinimumHeight(71)
self.recc_app_install_button_21.setFixedWidth(131)
self.recc_app_install_button_22 = custompushbutton('Install', parent=self)
self.recc_app_install_button_22.setMinimumHeight(71)
self.recc_app_install_button_22.setFixedWidth(131)
self.recc_app_install_button_23 = custompushbutton('Install', parent=self)
self.recc_app_install_button_23.setMinimumHeight(71)
self.recc_app_install_button_23.setFixedWidth(131)
self.recc_app_install_button_24 = custompushbutton('Install', parent=self)
self.recc_app_install_button_24.setMinimumHeight(71)
self.recc_app_install_button_24.setFixedWidth(131)