Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
Bio.Application.ApplicationError Class Reference

List of all members.

Public Member Functions

def __init__
def __str__
def __repr__

Public Attributes

 returncode
 cmd
 stdout
 stderr

Detailed Description

Raised when an application returns a non-zero exit status.

The exit status will be stored in the returncode attribute, similarly
the command line string used in the cmd attribute, and (if captured)
stdout and stderr as strings.

This exception is a subclass of subprocess.CalledProcessError.

>>> err = ApplicationError(-11, "helloworld", "", "Some error text")
>>> err.returncode, err.cmd, err.stdout, err.stderr
(-11, 'helloworld', '', 'Some error text')
>>> print err
Command 'helloworld' returned non-zero exit status -11, 'Some error text'

Definition at line 50 of file __init__.py.


Constructor & Destructor Documentation

def Bio.Application.ApplicationError.__init__ (   self,
  returncode,
  cmd,
  stdout = "",
  stderr = "" 
)

Definition at line 66 of file __init__.py.

00066 
00067     def __init__(self, returncode, cmd, stdout="", stderr=""):
00068         self.returncode = returncode
00069         self.cmd = cmd
00070         self.stdout = stdout
00071         self.stderr = stderr
    

Here is the caller graph for this function:


Member Function Documentation

Definition at line 85 of file __init__.py.

00085 
00086     def __repr__(self):
00087         return "ApplicationError(%i, %s, %s, %s)" \
00088                % (self.returncode, self.cmd, self.stdout, self.stderr)
00089 

Definition at line 72 of file __init__.py.

00072 
00073     def __str__(self):
00074         #get first line of any stderr message
00075         try:
00076             msg = self.stderr.lstrip().split("\n",1)[0].rstrip()
00077         except:
00078             msg = ""
00079         if msg:
00080             return "Command '%s' returned non-zero exit status %d, %r" \
00081                    % (self.cmd, self.returncode, msg)
00082         else:
00083             return "Command '%s' returned non-zero exit status %d" \
00084                    % (self.cmd, self.returncode)
    

Here is the caller graph for this function:


Member Data Documentation

Definition at line 68 of file __init__.py.

Definition at line 67 of file __init__.py.

Definition at line 70 of file __init__.py.

Definition at line 69 of file __init__.py.


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