File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -25,24 +25,27 @@ def get_download_path():
2525downloads_path = get_download_path ()
2626
2727def extractor (file ):
28- if ".crdownload" in file :
28+ if ".crdownload" in file or ".tmp" in file :
2929 return
3030 formatted_file = file .split (sep )[- 1 ].split ("." )[0 ]
3131 destination_name = f"Extracted { formatted_file } "
3232 destination = downloads_path + sep + destination_name
33- sleep (0.5 )
3433 try :
3534 unpack_archive (
3635 file ,
3736 destination )
3837
38+ sleep (0.5 )
39+
3940 send2trash (file )
4041
4142 except :
4243 try :
4344 with SevenZipFile (file , mode = 'r' ) as archive :
4445 archive .extractall (path = destination )
4546
47+ sleep (0.5 )
48+
4649 send2trash (file )
4750 except :
4851 pass
@@ -68,6 +71,6 @@ def on_modified(self, event):
6871
6972 event_handler = EventHandler ()
7073 observer = Observer ()
71- observer .schedule (event_handler , downloads_path , recursive = True )
74+ observer .schedule (event_handler , downloads_path , recursive = False )
7275 observer .start ()
7376 observer .join ()
You can’t perform that action at this time.
0 commit comments