Package dlinklist :: Module linklist :: Class Return
[hide private]
[frames] | no frames]

Class Return

source code


Many methods in the API return a status value, this class provides an enumeration of the status valid return values.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
(str or int, str)
getMessage(self, num)
Return a tuple consisting of the text name of the status return value and the description of the status.
source code
Class Variables [hide private]
  NORMAL = 0
  MEM_ERROR = 1
  ZERO_INFO = 2
  NULL_LIST = 3
  NOT_FOUND = 4
  OPEN_ERROR = 5
  WRITE_ERROR = 6
  READ_ERROR = 7
  NOT_MODIFIED = 8
  NULL_FUNCTION = 9
  CONTINUE = 10
  __MESSAGES = {0: 'Normal operation', 1: 'malloc error', 2: 'si...
  _ERRORS = {0: 'NORMAL', 1: 'MEM_ERROR', 2: 'ZERO_INFO', 3: 'NU...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getMessage(self, num)
Class Method

source code 

Return a tuple consisting of the text name of the status return value and the description of the status. If the return value is invalid the number of the value is returned and the phrase 'Unknown error'.

Parameters:
  • num (int) - The numeric value from the Return class.
Returns: (str or int, str)
A tuple consisting of the text Return value and the description.

Class Variable Details [hide private]

__MESSAGES

Value:
{0: 'Normal operation',
 1: 'malloc error',
 2: 'sizeof(Info) is zero',
 3: 'List is NULL',
 4: 'Record not found',
 5: 'Cannot open file',
 6: 'File write error',
 7: 'File read error',
...

_ERRORS

Value:
{0: 'NORMAL',
 1: 'MEM_ERROR',
 2: 'ZERO_INFO',
 3: 'NULL_LIST',
 4: 'NOT_FOUND',
 5: 'OPEN_ERROR',
 6: 'WRITE_ERROR',
 7: 'READ_ERROR',
...