mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-31 19:35:21 +02:00
work on messages
This commit is contained in:
parent
b6f02e181a
commit
38251fdc8f
1 changed files with 5 additions and 0 deletions
|
@ -548,17 +548,22 @@ class PandoraBox:
|
||||||
self._log('PRESS KEY TO CLEAN')
|
self._log('PRESS KEY TO CLEAN')
|
||||||
self.screen.getch()
|
self.screen.getch()
|
||||||
# Remove infected files
|
# Remove infected files
|
||||||
|
files_removed = 0
|
||||||
for file in self.infected_files:
|
for file in self.infected_files:
|
||||||
try :
|
try :
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
self._log(f"{file} removed")
|
self._log(f"{file} removed")
|
||||||
logging.info(f'removed="{file}"')
|
logging.info(f'removed="{file}"')
|
||||||
|
files_removed += 1
|
||||||
except Exception as ex :
|
except Exception as ex :
|
||||||
self._log(f"Unexpected error: {str(ex)}")
|
self._log(f"Unexpected error: {str(ex)}")
|
||||||
logging.info(f'error="{str(ex)}"', exc_info=True)
|
logging.info(f'error="{str(ex)}"', exc_info=True)
|
||||||
os.system("sync")
|
os.system("sync")
|
||||||
if not self.has_curses:
|
if not self.has_curses:
|
||||||
self.display_image("OK")
|
self.display_image("OK")
|
||||||
|
else
|
||||||
|
self._log('Device cleaned !')
|
||||||
|
logging.info(f'cleaned="{files_removed}/{len(self.infected_files)}"')
|
||||||
else:
|
else:
|
||||||
if not self.has_curses:
|
if not self.has_curses:
|
||||||
self.display_image("OK")
|
self.display_image("OK")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue