Module Braille :: Class Braille
[hide private]
[frames] | no frames]

Class Braille

source code

AccessEngine.AEDevice.AEOutput.AEOutput --+
                                          |
                                         Braille

Defines the base class for all Braille output devices. Provides default implementation of parseString specific to Braille devices.

Instance Methods [hide private]
list of string
getCapabilities(self)
Returns: 'braille' as the only capability of this device.
source code
AEOutput
getProxy(self)
Looks at the AEOutput.USE_THREAD flag to see if the device implementing this interface wants a thread proxy or not.
source code
3-tuple of lists of string, AEPor, AEOutput.Style
parseString(self, text, style, por, sem)
Dummy implementation returns the text as-is.
source code
object
send(self, name, value, style=None)
Dispatches known commands to their appropriate handlers.
source code
 
sendCaret(self, pos, style)
Sends the current caret position relative to the first cell (zero-offset) on the device.
source code
 
sendTruncate(self, left, right, style)
Sends indicators of whether text was truncated on either side of the current line or not.
source code
tuple
sendGetEllipsisSizes(self, style)
Returns: tuple containing length of left and right ellipsis
source code
integer
sendGetMissingCellCount(self)
Returns: integer containing missing cell count
source code
 
sendString(self, text, style)
Sends a string of one or more characters to the device.
source code
 
sendFilename(self, fn, style)
Sends a string filename to the device, the contents of which should be output.
source code
 
sendStop(self, style=None)
Purges buffered text and styles, and interrupts on-going output.
source code
 
sendTalk(self, style=None)
Indicates all text buffered by sendString should now be output.
source code
Method Details [hide private]

getCapabilities(self)

source code 
Returns: list of string
'braille' as the only capability of this device.

getProxy(self)

source code 
Looks at the AEOutput.USE_THREAD flag to see if the device implementing this interface wants a thread proxy or not.
Returns: AEOutput
self
Raises:
  • NotImplementedError - When the interface wants a thread proxy.

parseString(self, text, style, por, sem)

source code 
Dummy implementation returns the text as-is.
Parameters:
  • text (string) - Text to be parsed
  • style (AEOutput.Style) - Style object defining how the text should be parsed
  • por (AEPor) - Point of regard for the first character in the text, or None if the text is not associated with a POR
  • sem (integer) - Semantic tag for the text
Returns: 3-tuple of lists of string, AEPor, AEOutput.Style
Parsed words

send(self, name, value, style=None)

source code 
Dispatches known commands to their appropriate handlers.
Parameters:
  • name (object) - Descriptor of the data value sent
  • value (object) - Content value
  • style (AEOutput.Style) - Style with which this value should be output
Returns: object
Return value specific to the given command
Raises:
  • NotImplementedError - When the handler for a common command is not implemented by a subclass

sendCaret(self, pos, style)

source code 
Sends the current caret position relative to the first cell (zero-offset) on the device. The style object is used by the device in deciding how the caret should be presented.
Parameters:
  • pos (string) - Zero-offset cell position of the caret, up to the device to change to one-offset if need be
  • style (AEOutput.Style) - Style with which the caret should be indicated
Raises:
  • NotImplementedError - When not overridden in a subclass

sendTruncate(self, left, right, style)

source code 
Sends indicators of whether text was truncated on either side of the current line or not. The style object is used by the device in deciding how the truncation should be presented.
Parameters:
  • left (boolean) - Was text truncated to the left?
  • right (boolean) - Was text truncated to the right?
  • style (AEOutput.Style) - Style with which the truncation should be indicated
Raises:
  • NotImplementedError - When not overridden in a subclass

sendGetEllipsisSizes(self, style)

source code 
Parameters:
Returns: tuple
tuple containing length of left and right ellipsis
Raises:
  • NotImplementedError - When not overridden in a subclass

sendGetMissingCellCount(self)

source code 
Returns: integer
integer containing missing cell count
Raises:
  • NotImplementedError - When not overridden in a subclass

sendString(self, text, style)

source code 
Sends a string of one or more characters to the device. The style object is used by the device in deciding how the given text should be presented.
Parameters:
  • text (string) - Text to send to the device
  • style (AEOutput.Style) - Style with which this text should be output
Raises:
  • NotImplementedError - When not overridden in a subclass

sendFilename(self, fn, style)

source code 

Sends a string filename to the device, the contents of which should be output. The style object is used by the device in decided how the given text should be presented.

Typically, this method should be implemented by an audio device that supports playback of waveform or sequencer files. It might also be used by devices as a way of synthesizing the entire contents of a file without having to pass all of the contents through the rest of the system.
Parameters:
  • fn (string) - Absolute filename
  • style (AEOutput.Style) - Style with which this text should be output
Raises:
  • NotImplementedError - When not overridden in a subclass

sendStop(self, style=None)

source code 
Purges buffered text and styles, and interrupts on-going output.
Parameters:
  • style (AEOutput.Style) - Style indicating which channel on which the stop should be performed; None indicates stop on all channels
Raises:
  • NotImplementedError - When not overridden in a subclass

sendTalk(self, style=None)

source code 
Indicates all text buffered by sendString should now be output. For devices that do the buffering in the driver, this action may mean simply sending the command. For devices that do not buffer, this action means sending text and styles buffered in the SUE device definition.
Parameters:
  • style (AEOutput.Style) - Style indicating which channel on which the talk should be performed; None indicates talk on all channels
Raises:
  • NotImplementedError - When not overridden in a subclass