ranger.core.actions
index
../../ranger/core/actions.py

# Copyright (C) 2009-2013  Roman Zimbelmann <hut@lavabit.com>
# This software is distributed under the terms of the GNU GPL version 3.

 
Modules
       
codecs
os
ranger
re
shutil
string
tempfile

 
Classes
       
ranger.core.shared.EnvironmentAware(builtins.object)
Actions(ranger.core.shared.FileManagerAware, ranger.core.shared.EnvironmentAware, ranger.core.shared.SettingsAware)
ranger.core.shared.FileManagerAware(builtins.object)
Actions(ranger.core.shared.FileManagerAware, ranger.core.shared.EnvironmentAware, ranger.core.shared.SettingsAware)
ranger.core.shared.SettingsAware(builtins.object)
Actions(ranger.core.shared.FileManagerAware, ranger.core.shared.EnvironmentAware, ranger.core.shared.SettingsAware)

 
class Actions(ranger.core.shared.FileManagerAware, ranger.core.shared.EnvironmentAware, ranger.core.shared.SettingsAware)
    
Method resolution order:
Actions
ranger.core.shared.FileManagerAware
ranger.core.shared.EnvironmentAware
ranger.core.shared.SettingsAware
builtins.object

Methods defined here:
abort(self)
cd(self, path, remember=True)
enter the directory at the given path, remember=True
change_mode(self, mode)
copy(self, mode='set', narg=None, dirarg=None)
Copy the selected items.  Modes are: 'set', 'add', 'remove'.
cut(self, mode='set', narg=None, dirarg=None)
delete(self)
display_command_help(self, console_widget)
display_file(self)
display_help(self)
display_log(self)
draw_bookmarks(self)
draw_possible_programs(self)
dump_commands(self)
dump_keybindings(self, *contexts)
dump_settings(self)
edit_file(self, file=None)
Calls execute_file with the current file and label='editor'
enter_bookmark(self, key)
Enter the bookmark with the name <key>
enter_dir(self, path, remember=False, history=True)
Enter the directory at the given path
execute_command(self, cmd, **kw)
execute_console(self, string='', wildcards=[], quantifier=None)
Execute a command for the console
execute_file(self, files, **kw)
Execute a file.
 
app is the name of a method in Applications, without the "app_"
flags is a string consisting of runner.ALLOWED_FLAGS
mode is a positive integer.
Both flags and mode specify how the program is run.
exit(self)
Exit the program
get_cumulative_size(self)
get_preview(self, file, width, height)
hide_bookmarks(self)
hide_console_info(self)
history_go(self, relative)
Move back and forth in the history
mark_files(self, all=False, toggle=False, val=None, movedown=None, narg=1)
A wrapper for the directory.mark_xyz functions.
 
Arguments:
all - change all files of the current directory at once?
toggle - toggle the marked-status?
val - mark or unmark?
mark_in_direction(self, val=True, dirarg=None)
mkdir(self, name)
move(self, narg=None, **kw)
A universal movement method.
 
Accepts these parameters:
(int) down, (int) up, (int) left, (int) right, (int) to,
(bool) absolute, (bool) relative, (bool) pages,
(bool) percentage
 
to=X is translated to down=X, absolute=True
 
Example:
move(down=4, pages=True)  # moves down by 4 pages.
move(to=2, pages=True)  # moves to page 2.
move(to=1, percentage=True)  # moves to 80%
move_parent(self, n, narg=None)
notify(self, text, duration=4, bad=False)
open_console(self, string='', prompt=None, position=None)
Open the console
pager_close(self)
pager_move(self, narg=None, **kw)
paste(self, overwrite=False)
Paste the selected items into the current directory
paste_hardlink(self)
paste_hardlinked_subtree(self)
paste_symlink(self, relative=False)
pause_tasks(self)
redraw_window(self)
Redraw the window
reload_cwd(self)
rename(self, src, dest)
reset(self)
Reset the filemanager, clearing the directory buffer
scroll(self, relative)
Scroll down by <relative> lines
search_file(self, text, offset=1, regexp=True)
search_next(self, order=None, offset=1, forward=True)
select_file(self, path)
set_bookmark(self, key)
Set the bookmark with the name <key> to the current directory
set_filter(self, fltr)
set_option(self, optname, value)
Set the value of an option named <optname>
set_option_from_string(self, option_name, value, localpath=None, tags=None)
set_search_method(self, order, forward=True)
sort(self, func=None, reverse=None)
source(self, filename)
substitute_macros(self, string, additional={}, escape=False)
tab_close(self, name=None)
tab_move(self, offset)
tab_new(self, path=None)
tab_open(self, name, path=None)
# --------------------------
# -- Tabs
# --------------------------
tab_restore(self)
tag_add(self, paths=None, movedown=None)
tag_remove(self, paths=None, movedown=None)
tag_toggle(self, paths=None, value=None, movedown=None, tag=None)
taskview_close(self)
taskview_move(self, narg=None, **kw)
taskview_open(self)
toggle_option(self, string)
Toggle a boolean option named <string>
toggle_visual_mode(self, reverse=False)
traverse(self)
uncut(self)
unset_bookmark(self, key)
Delete the bookmark with the name <key>
update_preview(self, path)
# --------------------------
# -- Previews
# --------------------------

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

Methods inherited from ranger.core.shared.EnvironmentAware:
env = None

 
Functions
       
getcwd(...)
getcwd() -> path
 
Return a unicode string representing the current working directory.
link(...)
link(src, dst, *, src_dir_fd=None, dst_dir_fd=None, follow_symlinks=True)
 
Create a hard link to a file.
 
If either src_dir_fd or dst_dir_fd is not None, it should be a file
  descriptor open to a directory, and the respective path string (src or dst)
  should be relative; the path will then be relative to that directory.
If follow_symlinks is False, and the last element of src is a symbolic
  link, link will create a link to the symbolic link itself instead of the
  file the link points to.
src_dir_fd, dst_dir_fd, and follow_symlinks may not be implemented on your
  platform.  If they are unavailable, using them will raise a
  NotImplementedError.
listdir(...)
listdir(path='.') -> list_of_filenames
 
Return a list containing the names of the files in the directory.
The list is in arbitrary order.  It does not include the special
entries '.' and '..' even if they are present in the directory.
 
path can be specified as either str or bytes.  If path is bytes,
  the filenames returned will also be bytes; in all other circumstances
  the filenames returned will be str.
On some platforms, path may also be specified as an open file descriptor;
  the file descriptor must refer to a directory.
  If this functionality is unavailable, using it raises NotImplementedError.
stat(path, *, dir_fd=None, follow_symlinks=True)
Perform a stat system call on the given path.
 
  path
    Path to be examined; can be string, bytes, or open-file-descriptor int.
  dir_fd
    If not None, it should be a file descriptor open to a directory,
    and path should be a relative string; path will then be relative to
    that directory.
  follow_symlinks
    If False, and the last element of the path is a symbolic link,
    stat will examine the symbolic link itself instead of the file
    the link points to.
 
dir_fd and follow_symlinks may not be implemented
  on your platform.  If they are unavailable, using them will raise a
  NotImplementedError.
 
It's an error to use dir_fd or follow_symlinks when specifying path as
  an open file descriptor.
symlink(...)
symlink(src, dst, target_is_directory=False, *, dir_fd=None)
 
Create a symbolic link pointing to src named dst.
 
target_is_directory is required on Windows if the target is to be
  interpreted as a directory.  (On Windows, symlink requires
  Windows 6.0 or greater, and raises a NotImplementedError otherwise.)
  target_is_directory is ignored on non-Windows platforms.
 
If dir_fd is not None, it should be a file descriptor open to a directory,
  and path should be relative; path will then be relative to that directory.
dir_fd may not be implemented on your platform.
  If it is unavailable, using it will raise a NotImplementedError.

 
Data
        ALLOWED_SETTINGS = {'autosave_bookmarks': <class 'bool'>, 'autoupdate_cumulative_size': <class 'bool'>, 'collapse_preview': <class 'bool'>, 'colorscheme': <class 'str'>, 'column_ratios': (<class 'tuple'>, <class 'list'>), 'confirm_on_delete': <class 'str'>, 'dirname_in_tabs': <class 'bool'>, 'display_size_in_main_column': <class 'bool'>, 'display_size_in_status_bar': <class 'bool'>, 'display_tags_in_all_columns': <class 'bool'>, ...}
ASK_COMMAND = 'ask'
MACRO_FAIL = '<\x01\x01MACRO_HAS_NO_VALUE\x01\x01>'
S_IEXEC = 64