Bug 908296 - Upgrade psutil to version 1.0.1; rs=glandium

Archive obtained from
https://psutil.googlecode.com/files/psutil-1.0.1.tar.gz and extracted
over existing source code without modifications.
This commit is contained in:
Gregory Szorc
2013-08-22 23:36:57 -07:00
parent 94e359dda6
commit 9fb86d2ef8
53 changed files with 3201 additions and 669 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -9,6 +9,7 @@ List all mounted disk partitions a-la "df -h" command.
"""
import sys
import os
import psutil
from psutil._compat import print_
@@ -33,6 +34,9 @@ def main():
templ = "%-17s %8s %8s %8s %5s%% %9s %s"
print_(templ % ("Device", "Total", "Used", "Free", "Use ", "Type", "Mount"))
for part in psutil.disk_partitions(all=False):
if os.name == 'nt' and 'cdrom' in part.opts:
# may raise ENOENT if there's no cd-rom in the drive
continue
usage = psutil.disk_usage(part.mountpoint)
print_(templ % (part.device,
bytes2human(usage.total),