From a83460d88a9982f704f2327ce0df359341369c49 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 9 Feb 2010 14:08:47 +0100 Subject: fsobject: added is_directory/is_file attributes --- ranger/fsobject/directory.py | 1 + ranger/fsobject/file.py | 3 +-- ranger/fsobject/fsobject.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index 0d417c96..91d087af 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -34,6 +34,7 @@ class NoDirectoryGiven(Exception): pass class Directory(FileSystemObject, Accumulator, SettingsAware): + is_directory = True enterable = False load_generator = None cycle_list = None diff --git a/ranger/fsobject/file.py b/ranger/fsobject/file.py index 71bd7a3e..f646ce17 100644 --- a/ranger/fsobject/file.py +++ b/ranger/fsobject/file.py @@ -14,5 +14,4 @@ from .fsobject import FileSystemObject as SuperClass class File(SuperClass): - pass - + is_file = True diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index df7a989f..3721aa54 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -19,6 +19,8 @@ DOCUMENT_BASENAMES = 'README TODO LICENSE COPYING INSTALL'.split() from . import T_FILE, T_DIRECTORY, T_UNKNOWN, T_NONEXISTANT, BAD_INFO from ranger.shared import MimeTypeAware, FileManagerAware class FileSystemObject(MimeTypeAware, FileManagerAware): + is_file = False + is_directory = False content_loaded = False force_load = False path = None -- cgit 1.4.1-2-gfad0