From ea1797127be066a38096c8c43a34cba554ff2089 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 22 Nov 2010 02:35:59 +0100 Subject: fsobject: The lazy lookup of .image attribute was *too* lazy Conflicts: ranger/fsobject/fsobject.py --- ranger/fsobject/fsobject.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 6e18d0e3..4db24eba 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -98,6 +98,10 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): except OSError: return "" + for attr in ('video', 'audio', 'image', 'media', 'document', 'container'): + exec("%s = lazy_property(" + "lambda self: self.set_mimetype() or self.%s)" % (attr, attr)) + def __str__(self): """returns a string containing the absolute path""" return str(self.path) -- cgit 1.4.1-2-gfad0