1
1
import PySimpleGUI as sg
2
- import os ,io
3
- from PIL import Image ,ImageTk
4
2
import webbrowser
5
3
from picklescan .src .picklescan .scanner import scan_directory_path
6
4
from picklescan .src .picklescan .scanner import scan_file_path
9
7
from picklescan .src .picklescan .scanner import scanned_files
10
8
from picklescan .src .picklescan .scanner import infected_files
11
9
import util .icons as ic
12
- from zipfile import BadZipFile
10
+
13
11
COLOR_DARK_GREEN = '#78BA04'
14
12
COLOR_DARK_BLUE = '#4974a5'
15
13
COLOR_RED_ORANGE = '#C13515'
@@ -51,12 +49,12 @@ def do_clipboard_operation(event, window, element):
51
49
window ['-status_info-' ].update (value = 'Nothing selected' )
52
50
53
51
def main ():
54
- ver = '0.1.1 '
52
+ ver = '0.1.2 '
55
53
sg .theme ('Dark Gray 15' )
56
54
app_title = f"Disty's Stable Diffusion Pickle Scanner GUI - Ver { ver } "
57
55
isError = 0
56
+
58
57
file_ext = {
59
-
60
58
("All" , "*.ckpt" ),
61
59
("All" , "*.pth" ),
62
60
("All" , "*.pt" ),
@@ -69,22 +67,9 @@ def main():
69
67
("All" , "*.npy" ),
70
68
("All" , "*.npy" ),
71
69
("All" , "*.npz" ),
72
- ("All" , "*.zip" ),
73
- # ("Pytorch Files", "*.ckpt"),
74
- # ("Pytorch Files", "*.pth"),
75
- # ("Pytorch Files", "*.pt"),
76
- # ("Pytorch Files", "*.bin"),
77
- # ("Pickle Files", "*.pkl"),
78
- # ("Pickle Files", "*.pickle"),
79
- # ("Pickle Files", "*.joblib"),
80
- # ("Pickle Files", "*.dat"),
81
- # ("Pickle Files", "*.data"),
82
- # ("Pickle Files", "*.npy"),
83
- # ("Pickle Files", "*.npy"),
84
- # ("Zip Files", "*.npz"),
85
- # ("Zip Files", "*.zip"),
70
+ ("All" , "*.zip" ),
86
71
}
87
-
72
+
88
73
#region layout
89
74
def browse_layout (type_ ,visible_ ,disabled = False ):
90
75
if type_ == 'huggingface' :
@@ -100,11 +85,10 @@ def browse_layout(type_,visible_,disabled=False):
100
85
[
101
86
sg .Input (key = f'-input_files_{ type_ } -' ,enable_events = True ,expand_x = True ,expand_y = True ,font = 'Ariel 11' ,background_color = COLOR_DARK_GRAY ,right_click_menu = right_click_menu ),
102
87
browse_type ,
103
-
104
88
],
105
89
],expand_x = True ,k = f'-frame_{ type_ } -' ,visible = visible_ ,relief = sg .RELIEF_SOLID ,border_width = 1 ,background_color = COLOR_GRAY_9900 )
106
90
return layout
107
-
91
+
108
92
top_column = [
109
93
[
110
94
sg .Frame ('' ,[
@@ -115,9 +99,8 @@ def browse_layout(type_,visible_,disabled=False):
115
99
sg .Radio ('Directory' ,'-type_selector_input_radio-' ,default = False ,k = '-directory_radio-' ,enable_events = True ),
116
100
sg .Frame ('' ,[
117
101
[
118
- sg .Button (image_data = ic .buymeacoffee ,expand_x = False ,visible = True ,enable_events = True ,key = "-buymeacoffee-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
119
- sg .Button (image_data = ic .kofi ,expand_x = False ,visible = True ,enable_events = True ,key = "-kofi-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
120
- sg .Button (image_data = ic .coindrop ,expand_x = False ,visible = True ,enable_events = True ,key = "-coindrop-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
102
+ sg .Button (image_data = ic .patreon ,expand_x = False ,visible = True ,enable_events = True ,key = "-patreon-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
103
+ sg .Button (image_data = ic .supportme ,expand_x = False ,visible = True ,enable_events = True ,key = "-supportme-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
121
104
sg .Button (image_data = ic .github ,expand_x = False ,visible = True ,enable_events = True ,key = "-github-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 ))
122
105
],
123
106
],expand_x = True ,expand_y = False ,relief = sg .RELIEF_SOLID ,border_width = 1 ,visible = True ,background_color = COLOR_GRAY_9900 ,element_justification = "r" )
@@ -135,7 +118,6 @@ def browse_layout(type_,visible_,disabled=False):
135
118
],
136
119
]
137
120
138
-
139
121
console_column = [
140
122
[
141
123
sg .Frame ('' ,[
@@ -215,9 +197,9 @@ def browse_layout(type_,visible_,disabled=False):
215
197
dangerous_globals_text_widget = window ["-dangerous_globals_text-" ]
216
198
console_ml_widget = window ["-console_ml-" ]
217
199
status_info_widget = window ["-status_info-" ]
218
- buymeacoffee_widget = window ["-buymeacoffee -" ]
219
- kofi_widget = window ["-kofi -" ]
220
- coindrop_widget = window ["-coindrop -" ]
200
+ patreon_widget = window ["-patreon -" ]
201
+ supportme_widget = window ["-supportme -" ]
202
+ github_widget = window ["-github -" ]
221
203
222
204
github_widget = window ["-github-" ]
223
205
@@ -232,10 +214,9 @@ def browse_layout(type_,visible_,disabled=False):
232
214
input_files_url_widget ,
233
215
input_files_file_widget ,
234
216
input_files_directory_widget ,
235
- buymeacoffee_widget ,
217
+ patreon_widget ,
236
218
github_widget ,
237
- kofi_widget ,
238
- coindrop_widget
219
+ supportme_widget ,
239
220
}
240
221
for widget in widgets :
241
222
widget .Widget .config (relief = 'flat' )
@@ -404,15 +385,14 @@ def browse_layout(type_,visible_,disabled=False):
404
385
if event == '-url_clear_button-' :
405
386
input_files_url_widget .update (value = '' )
406
387
407
- if event == "-buymeacoffee-" :
408
- webbrowser .open ("https://www.buymeacoffee.com/disty" )
388
+
389
+ if event == "-patreon-" :
390
+ webbrowser .open ("https://www.patreon.com/distyx" )
409
391
if event == "-github-" :
410
392
webbrowser .open ("https://github.com/diStyApps/Stable-Diffusion-Pickle-Scanner-GUI" )
411
- if event == "-kofi-" :
412
- webbrowser .open ("https://ko-fi.com/disty" )
413
- if event == "-coindrop-" :
393
+ if event == "-supportme-" :
414
394
webbrowser .open ("https://coindrop.to/disty" )
415
-
395
+
416
396
if event in right_click_menu [1 ]:
417
397
if values ['-huggingface_radio-' ]:
418
398
do_clipboard_operation (event , window , input_files_huggingface_widget )
@@ -425,15 +405,5 @@ def browse_layout(type_,visible_,disabled=False):
425
405
426
406
window ['-console_ml-' ].update (value = '' )
427
407
428
- # if event == 'Clear':
429
- # if values['-huggingface_radio-']:
430
- # input_files_huggingface_widget.update(value='')
431
- # if values['-url_radio-']:
432
- # input_files_url_widget.update(value='')
433
- # if values['-file_radio-']:
434
- # input_files_file_widget.update(value='')
435
- # if values['-directory_radio-']:
436
- # input_files_directory_widget.update(value='')
437
-
438
408
if __name__ == '__main__' :
439
409
main ()
0 commit comments