mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-19 13:29:42 +02:00
work in progress
This commit is contained in:
parent
8191e075cf
commit
6c831b1e01
3 changed files with 138 additions and 48 deletions
|
@ -27,6 +27,11 @@ def printDeviceInfo(dev):
|
|||
print("USB driver: %s" % dev.get("ID_USB_DRIVER"))
|
||||
print("Path id: %s" % dev.get("ID_PATH"))
|
||||
print('Usage: %s' % dev.get("ID_FS_USAGE"))
|
||||
print('Serial short: %s' % dev.get("ID_SERIAL_SHORT"))
|
||||
print('Serial: %s' % dev.get("ID_SERIAL"))
|
||||
print('Model: %s' % dev.get("ID_MODEL_ID"))
|
||||
print(os.stat(dev.get("DEVNAME")))
|
||||
|
||||
print("</BLOCK INFORMATION>")
|
||||
print("")
|
||||
|
||||
|
@ -47,6 +52,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))
|
||||
found = True
|
||||
loop += 1
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue