diff options
author | hut <hut@lavabit.com> | 2010-01-07 00:52:15 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-07 00:52:15 +0100 |
commit | 3db854eee17ff7e9c29319be04f8ae2b3e966bbf (patch) | |
tree | 5cd244585885a5f0eb238a9a5b2bb3900b30bb02 | |
parent | a808a661b1368e74cbb67fb1de021e746a1d53d1 (diff) | |
download | ranger-3db854eee17ff7e9c29319be04f8ae2b3e966bbf.tar.gz |
directory: fixed wrong mtime comparison
-rw-r--r-- | ranger/fsobject/directory.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index f1810915..1079d126 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -1,6 +1,8 @@ +import os from collections import deque from time import time +from ranger import log from ranger.fsobject import BAD_INFO, File, FileSystemObject from ranger.shared import SettingsAware from ranger.ext.accumulator import Accumulator @@ -31,6 +33,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): scroll_offset = 0 last_update_time = -1 + load_content_mtime = -1 old_show_hidden = None old_directories_first = None @@ -182,6 +185,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): self.last_update_time = time() finally: + self.load_content_mtime = os.lstat(self.path).st_mtime self.loading = False def unload(self): @@ -329,13 +333,12 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): self.load_content(*a, **k) return True - import os try: real_mtime = os.lstat(self.path).st_mtime except OSError: real_mtime = None if self.stat: - cached_mtime = self.stat.st_mtime + cached_mtime = self.load_content_mtime else: cached_mtime = 0 |