From ca44b07676fd0ffaf9be9e2ad6c211f84973cde4 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 23 May 2010 03:11:20 +0200 Subject: fsobject.fsobject: removed access() call in load function --- ranger/fsobject/directory.py | 2 +- ranger/fsobject/fsobject.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index 50564835..1cef8ed8 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -165,7 +165,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): self.load_if_outdated() try: - if self.exists and self.runnable: + if self.runnable: yield self.mount_path = mount_path(self.path) diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index f933cfc3..9ec7b2cb 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -48,7 +48,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): is_socket, accessible, - exists, + exists, # "exists" currently means "link_target_exists" loaded, marked, runnable, @@ -174,14 +174,16 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): if is_link: new_stat = self.preload[0] self.preload = None + self.exists = new_stat and True or False else: try: new_stat = lstat(path) is_link = (new_stat.st_mode & 0o120000) == 0o120000 if is_link: new_stat = stat(path) + self.exists = True except: - pass + self.exists = False # Set some attributes if new_stat: @@ -191,13 +193,6 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): self.is_fifo = (mode & 0o010000) == 0o010000 self.is_link = is_link self.is_socket = (mode & 0o140000) == 0o140000 - if access(path, 0): - self.exists = True - if self.is_directory: - self.runnable = (mode & 0o0100) == 0o0100 - else: - self.exists = False - self.runnable = False else: self.accessible = False -- cgit 1.4.1-2-gfad0