Package libavg :: Module avg :: Class ParPort

Class ParPort


Used for low-level control of the parallel port's data, status and control lines.

Instance Methods
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
clearDataLines(lines)
Clears data lines.
 
getStatusLine(line)
Returns the value of one of the parallel port status lines.
None
init(devicename)
Opens a parallel port.
 
isAvailable()
Returns True if the parallel port has been opened successfully, False otherwise.
 
setAllDataLines(lines)
Changes the value of all data lines.
 
setControlLine(line, value)
 
setDataLines(lines)
Sets data lines.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  __instance_size__ = 24
Properties

Inherited from object: __class__

Method Details

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

clearDataLines(lines)

 

Clears data lines.

Parameters:
  • lines - The lines to clear. Constants to used for these lines are PARPORTDATA0-PARPORTDATA7. Several of these constants can be or'ed together to set several lines. The lines not mentioned in the parameter are left unchanged.
Returns:
True if the lines were cleared, False otherwise.

getStatusLine(line)

 

Returns the value of one of the parallel port status lines.

Parameters:
  • line - Which status line to query. Possible values for line are STATUS_ERROR, STATUS_SELECT, STATUS_PAPEROUT, STATUS_ACK and STATUS_BUSY.
Returns:
True if the line is set.

init(devicename)

 

Opens a parallel port.

Parameters:
  • devicename - Device filename to use. If DeviceName is an empty string, /dev/parport0 is used as device name.
Returns: None

setAllDataLines(lines)

 

Changes the value of all data lines.

Parameters:
  • lines - The lines to set. Constants to used for these lines are PARPORTDATA0-PARPORTDATA7. Several of these constants can be or'ed together to set several lines. The lines not mentioned in the parameter are cleared.
Returns:
True if the lines were set, False otherwise.

setDataLines(lines)

 

Sets data lines.

Parameters:
  • lines - The lines to set. Constants to used for these lines are PARPORTDATA0-PARPORTDATA7. Several of these constants can be or'ed together to set several lines. The lines not mentioned in the parameter are left unchanged.
Returns:
True if the lines were set, False otherwise.