disk_eraser/main.py

26 lines
800 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from utils.utils_drive import Drive
from utils.globals import *
if OS_TYPE == "Windows":
import wmi
c = wmi.WMI()
drives = []
if disks := c.Win32_DiskDrive():
for disk in disks:
drives.append(Drive(disk.Model, disk.Name, disk.InterfaceType, disk.DefaultBlockSize, int(disk.Size)))
elif OS_TYPE == "Linux":
import subprocess
# Execute the lsblk command to get information about block devices
result = subprocess.run(['lsblk', '-o', 'NAME,SIZE,MODEL,VENDOR,TRAN'], capture_output=True, text=True)
# Get the output
output = result.stdout
# Вывод информации о дисках
print(output)
# for drive in drives:
# print(f"{drive.name} | {drive.path} | {drive.disk_type} | {drive.block_size} | {drive.capacity}")