diff options
author | toonn <toonn@toonn.io> | 2021-07-14 20:39:21 +0200 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2021-07-14 20:39:21 +0200 |
commit | 5d6b5f62e5e7f8ffbd6a68c2d66d2fc2bf5ef268 (patch) | |
tree | d2a20f6e9cfbf74fd1a4fabe9763c482e579ce0d | |
parent | 3a9d64f6ba0d45915f0f2e0f6b1bb8bf88e7d2f3 (diff) | |
parent | bab7676e27b433915b6782c37d5e44db08f9d053 (diff) | |
download | ranger-5d6b5f62e5e7f8ffbd6a68c2d66d2fc2bf5ef268.tar.gz |
Merge branch 'clarify-imgdisplayunsupported'
-rw-r--r-- | ranger/ext/img_display.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py index 6cb6a815..b7e6572f 100644 --- a/ranger/ext/img_display.py +++ b/ranger/ext/img_display.py @@ -31,7 +31,7 @@ import codecs from tempfile import NamedTemporaryFile from ranger import PY3 -from ranger.core.shared import FileManagerAware +from ranger.core.shared import FileManagerAware, SettingsAware W3MIMGDISPLAY_ENV = "W3MIMGDISPLAY_PATH" W3MIMGDISPLAY_OPTIONS = [] @@ -70,8 +70,14 @@ class ImageDisplayError(Exception): pass -class ImgDisplayUnsupportedException(Exception): - pass +class ImgDisplayUnsupportedException(Exception, SettingsAware): + def __init__(self, message=None): + if message is None: + message = ( + '"{0}" does not appear to be a valid setting for' + ' preview_images_method.' + ).format(self.settings.preview_images_method) + super(ImgDisplayUnsupportedException, self).__init__(message) def fallback_image_displayer(): |