diff options
author | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2018-06-17 15:07:56 +0200 |
---|---|---|
committer | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2018-06-17 15:07:56 +0200 |
commit | 325f41e6a841ab1413020b9d2d86c3922d90f407 (patch) | |
tree | 71c5c8c45993c91fe564ab9da98c2ea94cff82f2 | |
parent | 835065f2819f2dde2426e203996c12862a97d3f8 (diff) | |
download | ranger-325f41e6a841ab1413020b9d2d86c3922d90f407.tar.gz |
Fix the issues reported by the coverage test (#1206)
Regarding the change in ranger/core/runner.py: setting the 'f' flag causes the 'r' flag to run sudo -b which forks on it own so it should be safe to not explicitly fork in this case.
-rw-r--r-- | ranger/core/runner.py | 2 | ||||
-rw-r--r-- | ranger/gui/widgets/browsercolumn.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/ranger/core/runner.py b/ranger/core/runner.py index bb4e512a..f38b026a 100644 --- a/ranger/core/runner.py +++ b/ranger/core/runner.py @@ -235,7 +235,7 @@ class Runner(object): # pylint: disable=too-few-public-methods self.fm.signal_emit('runner.execute.before', popen_kws=popen_kws, context=context) try: - if 'f' in context.flags: + if 'f' in context.flags and 'r' not in context.flags: # This can fail and return False if os.fork() is not # supported, but we assume it is, since curses is used. Popen_forked(**popen_kws) diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 95260813..bc6f7b1b 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -189,12 +189,12 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes def _draw_file(self): """Draw a preview of the file, if the settings allow it""" self.win.move(0, 0) - if not self.target.accessible: - self.addnstr("not accessible", self.wid) + if self.target is None or not self.target.has_preview(): Pager.close(self) return - if self.target is None or not self.target.has_preview(): + if not self.target.accessible: + self.addnstr("not accessible", self.wid) Pager.close(self) return |