1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-19 13:29:42 +02:00

code quality

This commit is contained in:
dbarzin 2023-02-25 18:59:41 +01:00
parent ccf1a9b31c
commit ed789fb9e8
8 changed files with 37 additions and 44 deletions

View file

@ -1,5 +1,4 @@
#!/usr/bin/python3
import pyudev
import psutil
import time
@ -51,9 +50,9 @@ for device in iter(monitor.poll, None):
for partition in psutil.disk_partitions():
if partition.device == device.device_node:
print("Mounted at {}".format(partition.mountpoint))
statvfs=os.statvfs(partition.mountpoint)
print("size %4.1fGB"% (statvfs.f_frsize * statvfs.f_blocks // 1024 // 1024 / 1024))
print("used %4.1fGB"% (statvfs.f_frsize * (statvfs.f_blocks - statvfs.f_bfree) // 1024 // 1024 / 1024))
statvfs = os.statvfs(partition.mountpoint)
print("size %4.1fGB" % (statvfs.f_frsize * statvfs.f_blocks // 1024 // 1024 / 1024))
print("used %4.1fGB" % (statvfs.f_frsize * (statvfs.f_blocks - statvfs.f_bfree) // 1024 // 1024 / 1024))
found = True
loop += 1
else: