Package AccessEngine :: Package AEDevice :: Module AEDeviceEvent
[hide private]
[frames] | no frames]

Source Code for Module AccessEngine.AEDevice.AEDeviceEvent

 1  ''' 
 2  @author: Scott Haeger 
 3  @organization: IBM Corporation 
 4  @copyright: Copyright (c) 2005, 2007 IBM Corporation 
 5  @license: The BSD License 
 6   
 7  @author: Ramona Bunk 
 8  @organization: IT Science Center Ruegen gGmbH, Germany 
 9  @copyright: Copyright (c) 2007, 2008 ITSC Ruegen 
10  @license: The BSD License 
11   
12  All rights reserved. This program and the accompanying materials are made 
13  available under the terms of the BSD license which accompanies 
14  this distribution, and is available at 
15  U{http://www.opensource.org/licenses/bsd-license.php} 
16  ''' 
17   
18  from AccessEngine import AEConstants 
19   
20 -class AEDeviceEvent(object):
21 ''' 22 Base type for indicating IO events to monitors such that a monitor may 23 select whether to monitor input, output, both, or neither based on this 24 type and its subtypes. 25 26 The L{cmd} attribute of an instance of this class should be considered 27 public readable. 28 29 @ivar cmd: Command constant for this event 30 @type cmd: object 31 '''
32 - def __init__(self, cmd):
33 ''' 34 Stores the command constant. 35 36 @param cmd: Command constant for this event 37 @type cmd: object 38 ''' 39 self.cmd = cmd
40
41 -class InputEvent(AEDeviceEvent):
42 '''Event on an input device, wrapped for display by a L{AEMonitor}.'''
43 - def getName(self):
44 ''' 45 @return: Human readable name for the command 46 @rtype: string 47 ''' 48 return AEConstants.INPUT_COMMAND_NAMES[self.cmd]
49
50 -class OutputEvent(AEDeviceEvent):
51 '''Event on an output device, wrapped for display by a L{AEMonitor}.'''
52 - def getName(self):
53 ''' 54 @return: Human readable name for the command 55 @rtype: string 56 ''' 57 return AEConstants.OUTPUT_COMMAND_NAMES[self.cmd]
58