Logo Search packages:      
Sourcecode: ranger version File versions  Download package

Public Member Functions | Private Member Functions

ranger::api::apps::Applications Class Reference

Inheritance diagram for ranger::api::apps::Applications:
Inheritance graph
Collaboration diagram for ranger::api::apps::Applications:
Collaboration graph

List of all members.

Public Member Functions

def all
def app_self
def apply
def either
def fm
def generic
def get
def has

Private Member Functions

def _meets_dependencies

Detailed Description

This class contains definitions on how to run programs and should
be extended in ranger.apps

The user can decide what program to run, and if he uses eg. 'vim', the
function app_vim() will be called.  However, usually the user
simply wants to "start" the file without specific instructions.
In such a case, app_default() is called, where you should examine
the context and decide which program to use.

All app functions have a name starting with app_ and return a string
containing the whole command or a tuple containing a list of the
arguments. They are supplied with one argument, which is the
AppContext instance.

You should define at least app_default, app_pager and app_editor since
internal functions depend on those.  Here are sample implementations:

def app_default(self, context):
      if context.file.media:
            if context.file.video:
                  # detach videos from the filemanager
                  context.flags += 'd'
            return self.app_mplayer(context)
            return self.app_editor(context)

def app_pager(self, context):
      return ('less', ) + tuple(context)

def app_editor(self, context):
      return ('vim', ) + tuple(context)

Definition at line 23 of file apps.py.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index