1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-08-05 05:45:22 +02:00

work in progress

This commit is contained in:
dbarzin 2022-06-12 00:26:34 +02:00
parent 8191e075cf
commit 6c831b1e01
3 changed files with 138 additions and 48 deletions

View file

@ -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:

View file

@ -14,11 +14,9 @@ def initBar():
def updateBar(progress):
global progress_win
rangex = (60 / float(100)) * progress
pos = int(rangex)
display = "#"
if pos != 0:
progress_win.addstr(1, pos, "{}".format(display))
pos = (60 * progress) // 100
if pos != 0 :
progress_win.addstr(1, pos, "{}".format("#"))
progress_win.refresh()
@ -31,5 +29,5 @@ while loading < 100:
time.sleep(1)
curses.endwin()
#curses.endwin()
curses.flushinp()