88from picklescan .src .picklescan .scanner import scan_huggingface_model
99from picklescan .src .picklescan .scanner import scanned_files
1010from picklescan .src .picklescan .scanner import infected_files
11-
11+ import util . icons as ic
1212COLOR_DARK_GREEN = '#78BA04'
1313COLOR_DARK_BLUE = '#4974a5'
1414COLOR_RED_ORANGE = '#C13515'
2424
2525right_click_menu = ['' , ['Copy' , 'Paste' , 'Cut' ]]
2626
27- def image_bio (filename ,size ):
28- if os .path .exists (filename ):
29- image1 = Image .open (filename )
30- if size [0 ]> 0 :
31- image1 .thumbnail (size )
32- bio = io .BytesIO ()
33- image1 .save (bio ,format = "PNG" )
34- del image1
35- return bio .getvalue ()
36-
3727def do_clipboard_operation (event , window , element ):
3828 if event == 'Select All' :
3929 element .Widget .selection_clear ()
@@ -58,7 +48,6 @@ def do_clipboard_operation(event, window, element):
5848 except :
5949 # print('Nothing selected')
6050 window ['-status_info-' ].update (value = 'Nothing selected' )
61-
6251def main ():
6352 ver = '0.1.0'
6453 sg .theme ('Dark Gray 15' )
@@ -109,11 +98,10 @@ def browse_layout(type_,visible_,disabled=False):
10998 sg .Radio ('Directory' ,'-type_selector_input_radio-' ,default = False ,k = '-directory_radio-' ,enable_events = True ),
11099 sg .Frame ('' ,[
111100 [
112- sg .Button (image_data = image_bio ('./media/buymeacoffee.png' ,(133 ,500 )),expand_x = False ,visible = True ,enable_events = True ,key = "-buymeacoffee-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
113- sg .Button (image_data = image_bio ('./media/kofi.png' ,(60 ,500 )),expand_x = False ,visible = True ,enable_events = True ,key = "-kofi-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
114- sg .Button (image_data = image_bio ('./media/coindrop.png' ,(95 ,500 )),expand_x = False ,visible = True ,enable_events = True ,key = "-coindrop-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
115-
116- sg .Button (image_data = image_bio ('./media/github.png' ,(80 ,500 )),expand_x = False ,visible = True ,enable_events = True ,key = "-github-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
101+ sg .Button (image_data = ic .buymeacoffee ,expand_x = False ,visible = True ,enable_events = True ,key = "-buymeacoffee-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
102+ sg .Button (image_data = ic .kofi ,expand_x = False ,visible = True ,enable_events = True ,key = "-kofi-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
103+ sg .Button (image_data = ic .coindrop ,expand_x = False ,visible = True ,enable_events = True ,key = "-coindrop-" ,button_color = (COLOR_GRAY_9900 ,COLOR_GRAY_9900 )),
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 ))
117105 ],
118106 ],expand_x = True ,expand_y = False ,relief = sg .RELIEF_SOLID ,border_width = 1 ,visible = True ,background_color = COLOR_GRAY_9900 ,element_justification = "r" )
119107
0 commit comments