Package tboard :: Module tboard :: Class ButtonID
[hide private]
[frames] | no frames]

Class ButtonID

source code

Enum used to identify gesture buttons.

Static Methods [hide private]
 
toString(buttonID)
Returns displayable description of the button.
source code
 
toButtonID(buttonLabel)
Given a button label, return the button's ID
source code
 
idToStringable(buttonID)
Return a string representing the meaning of a button.
source code
Class Variables [hide private]
  ABC = 0
  DEF = 1
  GHI = 2
  JKL = 3
  MNO = 4
  PQR = 5
  STUV = 6
  WXYZ = 7
  legalValues = [0, 1, 2, 3, 4, 5, 6, 7]
  strRepr = {0: 'ABC', 1: 'DEF', 2: 'GHI', 3: 'JKL', 4: 'MNO', 5...
  strToID = {'ABC': 0, 'DEF': 1, 'GHI': 2, 'JKL': 3, 'MNO': 4, '...
  idRepr = {0: '|abc|', 1: '|def|', 2: '|ghi|', 3: '|jkl|', 4: '...
Method Details [hide private]

toString(buttonID)
Static Method

source code 

Returns displayable description of the button.

Parameters:
  • buttonID ({ABC|DEF|JKL|MNO|PQR|STUV|WXYZ}) - a key in the idRepr dict

toButtonID(buttonLabel)
Static Method

source code 

Given a button label, return the button's ID

Parameters:
  • buttonLabel (string) - label that is printed on the button

idToStringable(buttonID)
Static Method

source code 

Return a string representing the meaning of a button.

Parameters:
  • buttonID ({ABC|DEF|JKL|MNO|PQR|STUV|WXYZ}) - a key in the idRepr dict
Raises:
  • ValueError - if button ID not recognized.

Class Variable Details [hide private]

strRepr

Value:
{0: 'ABC',
 1: 'DEF',
 2: 'GHI',
 3: 'JKL',
 4: 'MNO',
 5: 'PQR',
 6: 'STUV',
 7: 'WXYZ'}

strToID

Value:
{'ABC': 0,
 'DEF': 1,
 'GHI': 2,
 'JKL': 3,
 'MNO': 4,
 'PQR': 5,
 'STUV': 6,
 'WXYZ': 7}

idRepr

Value:
{0: '|abc|',
 1: '|def|',
 2: '|ghi|',
 3: '|jkl|',
 4: '|mno|',
 5: '|pqr|',
 6: '|stuv|',
 7: '|wxyz|'}