diff options
Diffstat (limited to 'ranger/core/actions.py')
-rw-r--r-- | ranger/core/actions.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index c7bdcfec..58f7aa20 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -21,8 +21,7 @@ from ranger.ext.keybinding_parser import key_to_string, construct_keybinding from ranger.ext.shell_escape import shell_quote from ranger.ext.next_available_filename import next_available_filename from ranger.ext.rifle import squash_flags, ASK_COMMAND -from ranger.core.shared import FileManagerAware, EnvironmentAware, \ - SettingsAware +from ranger.core.shared import FileManagerAware, SettingsAware from ranger.core.tab import Tab from ranger.container.file import File from ranger.core.loader import CommandLoader, CopyLoader @@ -36,7 +35,7 @@ class _MacroTemplate(string.Template): delimiter = ranger.MACRO_DELIMITER idpattern = r"[_a-z0-9]*" -class Actions(FileManagerAware, EnvironmentAware, SettingsAware): +class Actions(FileManagerAware, SettingsAware): # -------------------------- # -- Basic Commands # -------------------------- @@ -210,6 +209,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): macros = {} macros['rangerdir'] = ranger.RANGERDIR + macros['space'] = ' ' if self.fm.thisfile: macros['f'] = self.fm.thisfile.relative_path @@ -306,13 +306,17 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): (line, str(e)), bad=True) def execute_file(self, files, **kw): - """Execute a file. + """Uses the "rifle" module to open/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.""" - # TODO: docstring out of date + Arguments are the same as for ranger.ext.rifle.Rifle.execute: + + files: a list of file objects (not strings!) + number: a number to select which way to open the file, in case there + are multiple choices + label: a string to select an opening method by its label + flags: a string specifying additional options, see `man rifle` + mimetyle: pass the mimetype to rifle, overriding its own guess + """ mode = kw['mode'] if 'mode' in kw else 0 |