11import PySimpleGUI as sg
2- import os ,io
3- from PIL import Image ,ImageTk
42import webbrowser
53from picklescan .src .picklescan .scanner import scan_directory_path
64from picklescan .src .picklescan .scanner import scan_file_path
97from picklescan .src .picklescan .scanner import scanned_files
108from picklescan .src .picklescan .scanner import infected_files
119import util .icons as ic
12- from zipfile import BadZipFile
10+
1311COLOR_DARK_GREEN = '#78BA04'
1412COLOR_DARK_BLUE = '#4974a5'
1513COLOR_RED_ORANGE = '#C13515'
@@ -51,12 +49,12 @@ def do_clipboard_operation(event, window, element):
5149 window ['-status_info-' ].update (value = 'Nothing selected' )
5250
5351def main ():
54- ver = '0.1.1 '
52+ ver = '0.1.2 '
5553 sg .theme ('Dark Gray 15' )
5654 app_title = f"Disty's Stable Diffusion Pickle Scanner GUI - Ver { ver } "
5755 isError = 0
56+
5857 file_ext = {
59-
6058 ("All" , "*.ckpt" ),
6159 ("All" , "*.pth" ),
6260 ("All" , "*.pt" ),
@@ -69,22 +67,9 @@ def main():
6967 ("All" , "*.npy" ),
7068 ("All" , "*.npy" ),
7169 ("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" ),
8671 }
87-
72+
8873 #region layout
8974 def browse_layout (type_ ,visible_ ,disabled = False ):
9075 if type_ == 'huggingface' :
@@ -100,11 +85,10 @@ def browse_layout(type_,visible_,disabled=False):
10085 [
10186 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 ),
10287 browse_type ,
103-
10488 ],
10589 ],expand_x = True ,k = f'-frame_{ type_ } -' ,visible = visible_ ,relief = sg .RELIEF_SOLID ,border_width = 1 ,background_color = COLOR_GRAY_9900 )
10690 return layout
107-
91+
10892 top_column = [
10993 [
11094 sg .Frame ('' ,[
@@ -115,9 +99,8 @@ def browse_layout(type_,visible_,disabled=False):
11599 sg .Radio ('Directory' ,'-type_selector_input_radio-' ,default = False ,k = '-directory_radio-' ,enable_events = True ),
116100 sg .Frame ('' ,[
117101 [
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 )),
121104 sg .Button (image_data = ic .github ,expand_x = False ,visible = True ,enable_events = True ,key = "-github-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 ))
122105 ],
123106 ],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):
135118 ],
136119 ]
137120
138-
139121 console_column = [
140122 [
141123 sg .Frame ('' ,[
@@ -215,9 +197,9 @@ def browse_layout(type_,visible_,disabled=False):
215197 dangerous_globals_text_widget = window ["-dangerous_globals_text-" ]
216198 console_ml_widget = window ["-console_ml-" ]
217199 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 -" ]
221203
222204 github_widget = window ["-github-" ]
223205
@@ -232,10 +214,9 @@ def browse_layout(type_,visible_,disabled=False):
232214 input_files_url_widget ,
233215 input_files_file_widget ,
234216 input_files_directory_widget ,
235- buymeacoffee_widget ,
217+ patreon_widget ,
236218 github_widget ,
237- kofi_widget ,
238- coindrop_widget
219+ supportme_widget ,
239220 }
240221 for widget in widgets :
241222 widget .Widget .config (relief = 'flat' )
@@ -404,15 +385,14 @@ def browse_layout(type_,visible_,disabled=False):
404385 if event == '-url_clear_button-' :
405386 input_files_url_widget .update (value = '' )
406387
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" )
409391 if event == "-github-" :
410392 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-" :
414394 webbrowser .open ("https://coindrop.to/disty" )
415-
395+
416396 if event in right_click_menu [1 ]:
417397 if values ['-huggingface_radio-' ]:
418398 do_clipboard_operation (event , window , input_files_huggingface_widget )
@@ -425,15 +405,5 @@ def browse_layout(type_,visible_,disabled=False):
425405
426406 window ['-console_ml-' ].update (value = '' )
427407
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-
438408if __name__ == '__main__' :
439409 main ()
0 commit comments