Package AccessEngine :: Package AEEvent :: Module PrivateChange
[hide private]
[frames] | no frames]

Source Code for Module AccessEngine.AEEvent.PrivateChange

 1  ''' 
 2  Defines an L{AEEvent} encapsulating arbitrary private data intended to be 
 3  consumed by the L{AETierManager} or L{AETier}, but not passed on to 
 4  L{AEScript <AEScript.AEScript>}s or Tasks. 
 5   
 6  @author: Peter Parente 
 7  @organization: IBM Corporation 
 8  @copyright: Copyright (c) 2005, 2007 IBM Corporation 
 9  @license: The BSD License 
10   
11  @author: Frank Zenker 
12  @author: Ramona Bunk 
13  @organization: IT Science Center Ruegen gGmbH, Germany 
14  @copyright: Copyright (c) 2007, 2008 ITSC Ruegen 
15  @license: The BSD License 
16   
17  All rights reserved. This program and the accompanying materials are made  
18  available under the terms of the BSD license which accompanies 
19  this distribution, and is available at 
20  U{http://www.opensource.org/licenses/bsd-license.php} 
21  ''' 
22   
23  import AccessEngine 
24  import Base 
25   
26 -class PrivateChange(Base.AEEvent):
27 ''' 28 Event that fires when some change occurs. 29 30 @ivar kind: Kind of chage, one of class variables in this class 31 @type kind: integer 32 @ivar kwargs: Aribitrary data to be provided with the event 33 @type kwargs: dictionary 34 ''' 35 KEY_PRESS = 0 36
37 - def __init__(self, kind, **kwargs):
38 ''' 39 Calls the base class and stores the kind and data. 40 41 @param kind: Kind of chage, one of class variables in this class 42 @type kind: integer 43 @param kwargs: Aribitrary data to be provided with the event 44 @type kwargs: dictionary 45 ''' 46 Base.AEEvent.__init__(self, focused=True, **kwargs) 47 self.kind = kind 48 self.kwargs = kwargs
49
50 - def execute(self):
51 ''' 52 Contacts the L{AETierManager} so it can manage the private event. 53 54 @return: Always True to indicate the event executed properly 55 @rtype: boolean 56 ''' 57 AccessEngine.AETierManager.managePrivate(self) 58 return True
59
60 - def getDataForTask(self):
61 ''' 62 Fetches data out of this L{PrivateChange} for use by the L{AETierManager} 63 or a L{AETier}. 64 65 @return: Dictionary of parameters to be passed to a 66 L{AEScript.EventScript.onMouseChange}-Task as 67 follows: 68 - kind: The kind of event 69 - any additional data in the L{kwargs} instance variable 70 @rtype: dictionary 71 ''' 72 d = {} 73 d.update(self.kwargs) 74 d['kind'] = self.kind 75 return d
76