summaryrefslogtreecommitdiff
path: root/summainlib.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-02-12 23:44:39 +0000
committerLars Wirzenius <liw@liw.fi>2011-02-12 23:44:39 +0000
commite6357e4ee0d95eac3973452723010017eacf04a4 (patch)
treea0edcbcb3d2fdc67be9e507cb83517b42369e84b /summainlib.py
parentc843b1d069f1d82cf4a8758ffa3a3325fd5a82fd (diff)
downloadsummain-e6357e4ee0d95eac3973452723010017eacf04a4.tar.gz
Don't report size for directories.
It is meaningless.
Diffstat (limited to 'summainlib.py')
-rw-r--r--summainlib.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/summainlib.py b/summainlib.py
index 31b42a7..7f67908 100644
--- a/summainlib.py
+++ b/summainlib.py
@@ -99,7 +99,8 @@ class FilesystemObject(object):
self['Ino'] = '%d' % normalizer.get_ino(stat_result.st_ino)
self['Dev'] = '%d' % normalizer.get_dev(stat_result.st_dev)
self['Nlink'] = '%d' % stat_result.st_nlink
- self['Size'] = '%d' % stat_result.st_size
+ if not stat.S_ISDIR(stat_result.st_mode):
+ self['Size'] = '%d' % stat_result.st_size
self['Uid'] = '%d' % stat_result.st_uid
self['Username'] = self.lookup_username(stat_result.st_uid)
self['Gid'] = '%d' % stat_result.st_gid
@@ -146,3 +147,4 @@ class FilesystemObject(object):
for x in sorted(self.values.keys())
if x != 'Name']
return ''.join('%s: %s\n' % (key, self[key]) for key in keys)
+