diff options
-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(): |