ranger.fsobject.directory
index
/home/hut/ranger/ranger/fsobject/directory.py

# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

 
Modules
       
os
ranger

 
Classes
       
exceptions.Exception(exceptions.BaseException)
NoDirectoryGiven
ranger.ext.accumulator.Accumulator(__builtin__.object)
Directory(ranger.fsobject.fsobject.FileSystemObject, ranger.ext.accumulator.Accumulator, ranger.shared.settings.SettingsAware)
ranger.fsobject.fsobject.FileSystemObject(ranger.shared.mimetype.MimeTypeAware, ranger.shared.FileManagerAware)
Directory(ranger.fsobject.fsobject.FileSystemObject, ranger.ext.accumulator.Accumulator, ranger.shared.settings.SettingsAware)
ranger.shared.settings.SettingsAware(__builtin__.object)
Directory(ranger.fsobject.fsobject.FileSystemObject, ranger.ext.accumulator.Accumulator, ranger.shared.settings.SettingsAware)

 
class Directory(ranger.fsobject.fsobject.FileSystemObject, ranger.ext.accumulator.Accumulator, ranger.shared.settings.SettingsAware)
    
Method resolution order:
Directory
ranger.fsobject.fsobject.FileSystemObject
ranger.shared.mimetype.MimeTypeAware
ranger.shared.FileManagerAware
ranger.shared.Awareness
ranger.ext.accumulator.Accumulator
ranger.shared.settings.SettingsAware
__builtin__.object

Methods defined here:
__bool__ = __nonzero__(self)
__eq__(self, other)
Check for equality of the directories paths
__hash__(self)
__init__(self, path)
__len__(self)
The number of containing files
__neq__(self, other)
Check for inequality of the directories paths
__nonzero__(self)
Always True
correct_pointer(self)
Make sure the pointer is in the valid range
cycle(self, forward=True)
empty(self)
Is the directory empty?
get_list(self)
get_selection(self)
READ ONLY
load_bit_by_bit(self)
Returns a generator which load a part of the directory
in each iteration.
load_content(self, schedule=None)
Loads the contents of the directory. Use this sparingly since
it takes rather long.
load_content_if_outdated(self, *a, **k)
Load the contents of the directory if it's
outdated or not done yet
load_content_once(self, *a, **k)
Load the contents of the directory if not done yet
mark_all(self, val)
mark_item(self, item, val)
move_to_obj(self, arg)
search_fnc(self, fnc, forward=True)
set_cycle_list(self, lst)
sort(self)
Sort the containing files
sort_if_outdated(self)
Sort the containing files if they are outdated
toggle_all_marks(self)
toggle_mark(self, item)
unload(self)

Data and other attributes defined here:
cycle_list = None
disk_usage = 0
enterable = False
filenames = None
files = None
filter = None
is_directory = True
last_update_time = -1
load_content_mtime = -1
load_generator = None
loading = False
marked_items = None
mount_path = '/'
old_directories_first = None
old_filter = None
old_hidden_filter = None
old_reverse = None
old_show_hidden = None
old_sort = None
scroll_begin = 0
scroll_offset = 0
sort_dict = {'basename': <function sort_by_basename>, 'mtime': <function <lambda>>, 'size': <function <lambda>>, 'type': <function <lambda>>}

Methods inherited from ranger.fsobject.fsobject.FileSystemObject:
__str__(self)
returns a string containing the absolute path
get_description(self)
get_permission_string(self)
go(self)
enter the directory if the filemanager is running
is_older_than(self, seconds)
returns whether this object wasn't use()d in the last n seconds
load(self)
reads useful information about the filesystem-object from the
filesystem and caches it for later use
load_if_outdated(self)
Calls load() if the currently cached information is outdated
or nonexistant.
load_once(self)
calls load() if it has not been called at least once yet
mark(self, boolean)
set_mimetype(self)
assign attributes such as self.video according to the mimetype
use(self)
mark the filesystem-object as used at the current time

Data descriptors inherited from ranger.fsobject.fsobject.FileSystemObject:
filetype
shell_escaped_basename

Data and other attributes inherited from ranger.fsobject.fsobject.FileSystemObject:
accessible = False
audio = False
basename = None
basename_lower = None
container = False
content_loaded = False
dirname = None
document = False
exists = False
extension = None
force_load = False
image = False
infostring = None
is_file = False
islink = False
last_used = None
loaded = False
marked = False
media = False
mimetype_tuple = ()
path = None
permissions = None
readlink = None
runnable = False
size = 0
stat = None
stopped = False
tagged = False
type = 'unknown'
video = False

Data descriptors inherited from ranger.shared.mimetype.MimeTypeAware:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from ranger.shared.mimetype.MimeTypeAware:
mimetypes = {}

Data and other attributes inherited from ranger.shared.FileManagerAware:
fm = None

Methods inherited from ranger.ext.accumulator.Accumulator:
get_height(self)
OVERRIDE THIS
move(self, relative=0, absolute=None, pages=None, narg=None)
pointer_is_synced(self)
sync_index(self, **kw)

Data and other attributes inherited from ranger.shared.settings.SettingsAware:
settings = {}

 
class NoDirectoryGiven(exceptions.Exception)
    
Method resolution order:
NoDirectoryGiven
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
Functions
       
sort_by_basename(path)
returns path.basename (for sorting)
sort_by_directory(path)
returns 0 if path is a directory, otherwise 1 (for sorting)
time(...)
time() -> floating point number
 
Return the current time in seconds since the Epoch.
Fractions of a second may be present if the system clock provides them.

 
Data
        BAD_INFO = None