From f4449481a7ea0de117f65b1634bdc80621f8ec1b Mon Sep 17 00:00:00 2001 From: David Date: Tue, 15 May 2012 17:22:05 +0200 Subject: [PATCH] development on df_check --- df_check.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/df_check.py b/df_check.py index f35b0ce..4b620b6 100755 --- a/df_check.py +++ b/df_check.py @@ -4,17 +4,19 @@ import os file = open("/proc/partitions", "r") -file = file.read() +parts = file.read() +file.close() # getting all local partitions (regardless if mounted or not) partitions = [] -for line in file.split("\n"): - #if "sd" in line or "hd" in line: - #if line.split()[3] != None or line.split()[3] != "name": +blocks = [] +for line in parts.split("\n"): if line and "name" not in line and "sr0" not in line: - partitions.append(line.split()[3]) + if line.split()[2] != "1": + partitions.append(line.split()[3]) + blocks.append(line.split()[2]) -print "partitions on this system: %s" %(partitions) +print "partitions: %s \nblocks: %s" %(partitions, blocks) exit()