about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-11-20 18:28:55 +0100
committerhut <hut@lavabit.com>2010-11-20 18:28:55 +0100
commitfe6e709f4ccff7e0fe8aa8e492b79396012c780c (patch)
treef79f2dc0bfa33dee2fe060368f619051fc8e48a0
parent11fd0fe982ee72b30e007645e82f6bdb278f1bb4 (diff)
downloadranger-fe6e709f4ccff7e0fe8aa8e492b79396012c780c.tar.gz
fsobject: The lazy lookup of .image attribute was *too* lazy
-rw-r--r--ranger/fsobject/fsobject.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py
index 8468839d..f9b023d7 100644
--- a/ranger/fsobject/fsobject.py
+++ b/ranger/fsobject/fsobject.py
@@ -109,6 +109,10 @@ class FileSystemObject(FileManagerAware):
 		return [c if i % 3 == 1 else (int(c) if c else 0) for i, c in \
 			enumerate(_extract_number_re.split(self.basename_lower))]
 
+	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)