diff --git a/src/drive_handle.py b/src/drive_handle.py index 371cade37866df0e16ec15b300d265bdced8af33..3ba65a5c266066e1df64ea66031786f74d4511cc 100644 --- a/src/drive_handle.py +++ b/src/drive_handle.py @@ -1,5 +1,4 @@ import ctypes -import errno import os import shutil import subprocess @@ -152,13 +151,13 @@ class DriveHandle: path (str): The path to the pattern file """ print(colored(f"[DriveHandle] Writing a file ({path}) with a rolling pattern to fill the disk.", "light_grey")) - pattern_start_symbol : chr = 'A' - iteration : int = 0 + pattern_start_symbol: chr = 'A' + iteration: int = 0 (_, _, cluster_size) = self.get_allocation_unit_sizes() progressbar = Spinner('[DriveHandle] Writing the pattern file') with open(path, "wb") as file_descriptor: - while os.path.getsize(path)+cluster_size < self.get_free_drive_space(): - current_pattern_symbol : chr = chr(ord(pattern_start_symbol)+iteration) + while os.path.getsize(path) + cluster_size < self.get_free_drive_space(): + current_pattern_symbol: chr = chr(ord(pattern_start_symbol) + iteration) file_descriptor.write(current_pattern_symbol.encode() * cluster_size) iteration = (iteration + 1) % 26 progressbar.next()