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


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

Constructor & Destructor Documentation

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

Definition at line 66 of file

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

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

Definition at line 72 of file

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

Definition at line 67 of file

Definition at line 70 of file

Definition at line 69 of file

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