diff options
author | hut <hut@lavabit.com> | 2010-11-20 18:28:55 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-11-20 18:28:55 +0100 |
commit | fe6e709f4ccff7e0fe8aa8e492b79396012c780c (patch) | |
tree | f79f2dc0bfa33dee2fe060368f619051fc8e48a0 /ranger | |
parent | 11fd0fe982ee72b30e007645e82f6bdb278f1bb4 (diff) | |
download | ranger-fe6e709f4ccff7e0fe8aa8e492b79396012c780c.tar.gz |
fsobject: The lazy lookup of .image attribute was *too* lazy
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/fsobject/fsobject.py | 4 |
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) |