diff options
author | hut <hut@lavabit.com> | 2010-01-19 18:55:18 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-19 18:55:18 +0100 |
commit | b42eb058fb9987d807d0a813573745bad1e68248 (patch) | |
tree | ff13980405105725c0a0f31c0ec440b3a8dc6c8d /ranger/fsobject/directory.py | |
parent | a1274aba49793e6a48be95c2cece7d32e5d334f2 (diff) | |
download | ranger-b42eb058fb9987d807d0a813573745bad1e68248.tar.gz |
done #35: display disk usage of files in current directory
Diffstat (limited to 'ranger/fsobject/directory.py')
-rw-r--r-- | ranger/fsobject/directory.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index 79b39f69..d007f66e 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -47,6 +47,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): scroll_offset = 0 mount_path = '/' + disk_usage = 0 last_update_time = -1 load_content_mtime = -1 @@ -184,6 +185,9 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): files.append(item) yield + self.disk_usage = sum(isinstance(f, File) and f.size or 0 \ + for f in files) + self.scroll_offset = 0 self.filenames = filenames self.infostring = ' %d' % len(self.filenames) # update the infostring |