1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-25 08:19:41 +02:00

work on messages

This commit is contained in:
dbarzin 2023-02-24 14:12:14 +01:00
parent b6f02e181a
commit 38251fdc8f

View file

@ -548,17 +548,22 @@ class PandoraBox:
self._log('PRESS KEY TO CLEAN')
self.screen.getch()
# Remove infected files
files_removed = 0
for file in self.infected_files:
try :
os.remove(file)
self._log(f"{file} removed")
logging.info(f'removed="{file}"')
files_removed += 1
except Exception as ex :
self._log(f"Unexpected error: {str(ex)}")
logging.info(f'error="{str(ex)}"', exc_info=True)
os.system("sync")
if not self.has_curses:
self.display_image("OK")
else
self._log('Device cleaned !')
logging.info(f'cleaned="{files_removed}/{len(self.infected_files)}"')
else:
if not self.has_curses:
self.display_image("OK")