def __init__(self, evtType, expectedIds=0, evtData=None): ''' ''' # Create a placeholder for event instance argument data # such as the nCurses mouse tuple. self.ts_EventData = evtData if DEBUG: # Install Logger access try: # Start the default application logger. self.logger = tsLogger.TsLogger( threshold=tsLogger.ERROR, start=time.time(), name=tsLogger.StandardOutputFile) except Exception as e: self.logger = None msg = 'PyEventBinder._init__: Exception = %s' % e raise tse.ProgramException(tse.APPLICATION_TRAP, msg) # Check expected ids if expectedIds not in [0, 1, 2]: if DEBUG: msg = 'PyEventBinder._init__: Expected ids not 0, 1, or 2' self.logger.error(msg) raise ValueError(msg) self.expectedIds = expectedIds # Insure we can iterate on the event type self.ts_EventType = wx.tsMakeIterable(evtType)
def _getEvtType(self): ''' Easy with a property. ''' return (wx.tsMakeIterable(self.ts_EventType)) # (self.ts_EventType[0])