summary refs log tree commit diff stats
path: root/ranger
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 /ranger
parent11fd0fe982ee72b30e007645e82f6bdb278f1bb4 (diff)
downloadranger-fe6e709f4ccff7e0fe8aa8e492b79396012c780c.tar.gz
fsobject: The lazy lookup of .image attribute was *too* lazy
Diffstat (limited to 'ranger')
-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)
akkartik/mu/blame/cpp/tangle/boot.cc?h=hlt&id=1fba5d5d40136f74ee23250d5ccd5737e90bfd11'>^
51530916 ^

51530916 ^



51530916 ^

51530916 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51