diff options
author | hut <hut@lavabit.com> | 2012-01-04 22:21:39 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2012-01-04 22:21:39 +0100 |
commit | 8d0782c20ce033ae69fa6f134f68af0e9862acdc (patch) | |
tree | 8901f956ddae53b1c36ba4c0a989ce257d2a3e38 | |
parent | dd7e3aea6df8d3b85dd6ada555198f4a2209c78f (diff) | |
download | ranger-8d0782c20ce033ae69fa6f134f68af0e9862acdc.tar.gz |
widgets.statusbar: Include marked directory sizes in statusbar summary
-rw-r--r-- | ranger/core/actions.py | 1 | ||||
-rw-r--r-- | ranger/gui/widgets/statusbar.py | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 1fe99ada..8106a89b 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -122,6 +122,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): def get_cumulative_size(self): for f in self.env.get_selection() or (): f.look_up_cumulative_size() + self.ui.status.request_redraw() self.ui.redraw_main_column() def redraw_window(self): diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index a7d3fc73..7948b201 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -236,9 +236,9 @@ class StatusBar(Widget): if len(target.marked_items) == len(target.files): right.add(human_readable(target.disk_usage, separator='')) else: - right.add(human_readable(sum(f.size \ - for f in target.marked_items \ - if f.is_file), separator='')) + sumsize = sum(f.size for f in target.marked_items if not + f.is_directory or f._cumulative_size_calculated) + right.add(human_readable(sumsize, separator='')) right.add("/" + str(len(target.marked_items))) else: right.add(human_readable(target.disk_usage, separator='') + |