diff options
author | hut <hut@lavabit.com> | 2010-02-09 14:14:04 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-02-09 14:28:47 +0100 |
commit | aad614556f7f9ed40d9fe60fac0fb382eeeb85fb (patch) | |
tree | eeedf22918b9c275c0ad532c9e90d6e56884649c /ranger | |
parent | ab1a2682540aff4642886873c225b1f17635ef94 (diff) | |
download | ranger-aad614556f7f9ed40d9fe60fac0fb382eeeb85fb.tar.gz |
implemented #61: show sum of size of marked files
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/widgets/statusbar.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index a2b8dbd6..3aab5e2f 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -202,10 +202,18 @@ class StatusBar(Widget): max_pos = len(target) - self.column.hei base = 'scroll' - right.add(human_readable(target.disk_usage, seperator='')) - right.add(", ", "space") - right.add(human_readable(self.env.get_free_space(target.mount_path), - seperator='')) + if target.marked_items: + if len(target.marked_items) == len(target.files): + right.add(human_readable(target.disk_usage, seperator='')) + else: + right.add(human_readable(sum(f.size \ + for f in target.marked_items \ + if f.is_file), seperator='')) + else: + right.add(human_readable(target.disk_usage, seperator='')) + right.add(", ", "space") + right.add(human_readable(self.env.get_free_space( \ + target.mount_path), seperator='')) right.add(" ", "space") if target.marked_items: |