BASIS  r3148
basis::which Namespace Reference

Classes

class  WhichError

Functions

def main
def which
def whichall
def whichgen

Variables

list __all__ = ["which", "whichall", "whichgen", "WhichError"]
string __revision__ = "Id: which.py 1448 2007-02-28 19:13:06Z trentm"
string __version__ = '.'
tuple __version_info__ = (1, 1, 3)
string _cmdlnUsage

Function Documentation

def basis::which::main (   argv)

Definition at line 303 of file which.py.

def basis::which::which (   command,
  path = None,
  verbose = 0,
  exts = None 
)
Return the full path to the first match of the given command on
the path.

"command" is a the name of the executable to search for.
"path" is an optional alternate path list to search. The default it
    to use the PATH environment variable.
"verbose", if true, will cause a 2-tuple to be returned. The second
    element is a textual description of where the match was found.
"exts" optionally allows one to specify a list of extensions to use
    instead of the standard list for this system. This can
    effectively be used as an optimization to, for example, avoid
    stat's of "foo.vbs" when searching for "foo" and you know it is
    not a VisualBasic script but ".vbs" is on PATHEXT. This option
    is only supported on Windows.

If no match is found for the command, a WhichError is raised.

Definition at line 255 of file which.py.

def basis::which::whichall (   command,
  path = None,
  verbose = 0,
  exts = None 
)
Return a list of full paths to all matches of the given command
on the path.  

"command" is a the name of the executable to search for.
"path" is an optional alternate path list to search. The default it
    to use the PATH environment variable.
"verbose", if true, will cause a 2-tuple to be returned for each
    match. The second element is a textual description of where the
    match was found.
"exts" optionally allows one to specify a list of extensions to use
    instead of the standard list for this system. This can
    effectively be used as an optimization to, for example, avoid
    stat's of "foo.vbs" when searching for "foo" and you know it is
    not a VisualBasic script but ".vbs" is on PATHEXT. This option
    is only supported on Windows.

Definition at line 280 of file which.py.

def basis::which::whichgen (   command,
  path = None,
  verbose = 0,
  exts = None 
)
Return a generator of full paths to the given command.

"command" is a the name of the executable to search for.
"path" is an optional alternate path list to search. The default it
    to use the PATH environment variable.
"verbose", if true, will cause a 2-tuple to be returned for each
    match. The second element is a textual description of where the
    match was found.
"exts" optionally allows one to specify a list of extensions to use
    instead of the standard list for this system. This can
    effectively be used as an optimization to, for example, avoid
    stat's of "foo.vbs" when searching for "foo" and you know it is
    not a VisualBasic script but ".vbs" is on PATHEXT. This option
    is only supported on Windows.

This method returns a generator which yields either full paths to
the given command or, if verbose, tuples of the form (<path to
command>, <where path found>).

Definition at line 162 of file which.py.


Variable Documentation

list basis::which::__all__ = ["which", "whichall", "whichgen", "WhichError"]

Definition at line 91 of file which.py.

string basis::which::__revision__ = "Id: which.py 1448 2007-02-28 19:13:06Z trentm"

Definition at line 88 of file which.py.

Definition at line 90 of file which.py.

tuple basis::which::__version_info__ = (1, 1, 3)

Definition at line 89 of file which.py.

Definition at line 56 of file which.py.