Bug 1196253 - update in-tree psutil to 3.1.1. r=gps
This commit is contained in:
@@ -18,7 +18,6 @@ Device Total Used Free Use % Type Mount
|
||||
import sys
|
||||
import os
|
||||
import psutil
|
||||
from psutil._compat import print_
|
||||
|
||||
|
||||
def bytes2human(n):
|
||||
@@ -40,8 +39,8 @@ def bytes2human(n):
|
||||
|
||||
def main():
|
||||
templ = "%-17s %8s %8s %8s %5s%% %9s %s"
|
||||
print_(templ % ("Device", "Total", "Used", "Free", "Use ", "Type",
|
||||
"Mount"))
|
||||
print(templ % ("Device", "Total", "Used", "Free", "Use ", "Type",
|
||||
"Mount"))
|
||||
for part in psutil.disk_partitions(all=False):
|
||||
if os.name == 'nt':
|
||||
if 'cdrom' in part.opts or part.fstype == '':
|
||||
@@ -50,7 +49,7 @@ def main():
|
||||
# partition or just hang.
|
||||
continue
|
||||
usage = psutil.disk_usage(part.mountpoint)
|
||||
print_(templ % (
|
||||
print(templ % (
|
||||
part.device,
|
||||
bytes2human(usage.total),
|
||||
bytes2human(usage.used),
|
||||
|
||||
Reference in New Issue
Block a user