From d383965f431ee738a6db2da35d4092dfb108b739 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 26 May 2010 22:47:27 +0200 Subject: defaults.apps: simplify code for feh --- ranger/defaults/apps.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py index 97498a3e..cd745ff8 100644 --- a/ranger/defaults/apps.py +++ b/ranger/defaults/apps.py @@ -137,22 +137,10 @@ class CustomApplications(Applications): c.flags += 'd' - if c.mode in arg: + if c.mode in arg: # mode 1, 2 and 3 will set the image as the background return tup('feh', arg[c.mode], c.file.path) - if c.mode is 11: - if len(c.files) > 1: - return tup('feh', *c) - else: - from collections import deque - - # Open all image files in feh - directory = self.fm.env.get_directory(c.file.dirname) - images = [f.path for f in directory.files if f.image] - position = images.index(c.file.path) - deq = deque(images) - deq.rotate(-position) - - return tup('feh', *deq) + if c.mode is 11 and len(c.files) is 1: # view all files in the cwd + return tup('feh', self.fm.env.cwd.path, '--start-at', *c) return tup('feh', *c) @depends_on('aunpack') -- cgit 1.4.1-2-gfad0