mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-29 18:29:45 +02:00
fix bug
This commit is contained in:
parent
96aa5a144f
commit
84b10f0e66
1 changed files with 14 additions and 7 deletions
|
@ -424,15 +424,13 @@ class PandoraBox:
|
||||||
except Exception as ex :
|
except Exception as ex :
|
||||||
self._log(f"Unexpected error: {ex}")
|
self._log(f"Unexpected error: {ex}")
|
||||||
self._log("Scan failed !")
|
self._log("Scan failed !")
|
||||||
if not self.has_curses:
|
return "ERROR"
|
||||||
self.display_image("ERROR")
|
|
||||||
raise
|
|
||||||
self._update_bar(100)
|
self._update_bar(100)
|
||||||
self._log(
|
self._log(
|
||||||
f'duration="{int(time.time() - scan_start_time)}s", '\
|
f'duration="{int(time.time() - scan_start_time)}s", '\
|
||||||
f'files_scanned="{file_count}", '\
|
f'files_scanned="{file_count}", '\
|
||||||
f'files_infected="{len(self.infected_files)}"')
|
f'files_infected="{len(self.infected_files)}"')
|
||||||
return self.infected_files
|
return "CLEAN"
|
||||||
|
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
|
@ -518,9 +516,16 @@ class PandoraBox:
|
||||||
return "WAIT"
|
return "WAIT"
|
||||||
self._print_size(self._human_readable_size(statvfs.f_frsize * statvfs.f_blocks))
|
self._print_size(self._human_readable_size(statvfs.f_frsize * statvfs.f_blocks))
|
||||||
self._print_used(
|
self._print_used(
|
||||||
self._human_readable_size(statvfs.f_frsize * (statvfs.f_blocks - statvfs.f_bfree)))
|
self._human_readable_size(statvfs.f_frsize * (statvfs.f_blocks - statvfs.f_bfree)))
|
||||||
self.scan(statvfs.f_frsize * (statvfs.f_blocks - statvfs.f_bfree))
|
return self.scan(statvfs.f_frsize * (statvfs.f_blocks - statvfs.f_bfree))
|
||||||
return "CLEAN"
|
|
||||||
|
# --------------------------------------
|
||||||
|
|
||||||
|
def error(self):
|
||||||
|
""" Display error message """
|
||||||
|
if not self.has_curses:
|
||||||
|
self.display_image("ERROR")
|
||||||
|
return "WAIT"
|
||||||
|
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
|
@ -594,6 +599,8 @@ class PandoraBox:
|
||||||
return self.scan_device()
|
return self.scan_device()
|
||||||
case "CLEAN":
|
case "CLEAN":
|
||||||
return self.clean()
|
return self.clean()
|
||||||
|
case "ERROR":
|
||||||
|
return self.error()
|
||||||
case _:
|
case _:
|
||||||
return "STOP"
|
return "STOP"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue