diff options
author | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2018-03-04 15:07:23 +0100 |
---|---|---|
committer | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2018-03-04 15:08:04 +0100 |
commit | 72ea7926b30e0842ac213aab23d9f94df1cdbb50 (patch) | |
tree | d0e1e3cb49b565d8be86d3d92e0f154fa0d83b8c /ranger | |
parent | 727fd3aa19b904e6359d76792735fa155015a0ec (diff) | |
download | ranger-72ea7926b30e0842ac213aab23d9f94df1cdbb50.tar.gz |
Cleanup lists and generators
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/widgets/view_base.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ranger/gui/widgets/view_base.py b/ranger/gui/widgets/view_base.py index c87bdede..80061004 100644 --- a/ranger/gui/widgets/view_base.py +++ b/ranger/gui/widgets/view_base.py @@ -142,7 +142,7 @@ class ViewBase(Widget, DisplayableContainer): # pylint: disable=too-many-instan def action_string(hint): return hint[1] - return (list(sorted(group, key=action_string)) + return (sorted(group, key=action_string) for _, group in groupby( hints, @@ -154,12 +154,12 @@ class ViewBase(Widget, DisplayableContainer): # pylint: disable=too-many-instan if len(hints) > self.fm.settings.hint_collapse_threshold: def first_key_in_group(group): return group[0][0][0] - grouped_hints = [ + grouped_hints = ( [(first_key_in_group(hint_group), "...")] if len(hint_group) > 1 else hint_group for hint_group in grouped_hints - ] + ) # Sort by the first action in group. grouped_hints = sorted(grouped_hints, key=lambda g: g[0][1]) |