Package AccessEngine :: Package AEMonitor :: Module Base
[hide private]
[frames] | no frames]

Source Code for Module AccessEngine.AEMonitor.Base

  1  ''' 
  2  Defines the abstract base class for all L{AEMonitor} subclasses. 
  3   
  4  @author: Peter Parente 
  5  @organization: IBM Corporation 
  6  @copyright: Copyright (c) 2005, 2007 IBM Corporation 
  7  @license: The BSD License 
  8   
  9  All rights reserved. This program and the accompanying materials are made  
 10  available under the terms of the BSD license which accompanies 
 11  this distribution, and is available at 
 12  U{http://www.opensource.org/licenses/bsd-license.php} 
 13  ''' 
 14  from AccessEngine import AEUserInterface 
 15   
16 -class AEMonitor(AEUserInterface.AEUserInterface):
17 ''' 18 Most abstract base class for all L{AEMonitor} displays. 19 20 This class is abstract as most of its methods raise NotImplementedError and 21 need to be overriden in subclasses. 22 23 @ivar is_init: Is the monitor initialized via the L{init} method? 24 @type is_init: boolean 25 '''
26 - def __init__(self):
27 ''' 28 Sets the L{is_init} flag to False. 29 ''' 30 self.is_init = False
31
32 - def isInitialized(self):
33 ''' 34 Gets if the monitor is initialized or not. 35 36 @return: Is the dialog initialized? 37 @rtype: boolean 38 ''' 39 return self.is_init
40
41 - def init(self):
42 ''' 43 Sets the L{is_init} flag to True. Subclasses should override this method 44 to create and show their monitor's UI. 45 ''' 46 self.is_init = True
47
48 - def close(self):
49 ''' 50 Sets the L{is_init} flag to False. Subclasses should override this method 51 to hide and destroy their monitor's UI. 52 ''' 53 self.is_init = False
54
55 - def getEventType(self):
56 ''' 57 Abstract method. Gets the base class indicating the type of event of 58 interest to this monitor. 59 60 @return: Base type of the event this monitor should buffer 61 @rtype: class 62 @raise NotImplementedError: When this method is not overidden in a subclass 63 ''' 64 raise NotImplementedError
65
66 - def getEventNames(self):
67 ''' 68 Abstract method. Gets names identifying all possible kinds of events to be 69 monitored. The names are used to determine which events are actually 70 buffered once received by the monitor and which are ignored. 71 72 @return: All event kinds to potentially buffer 73 @rtype: list of string 74 @raise NotImplementedError: When this method is not overidden in a subclass 75 ''' 76 raise NotImplementedError
77
78 - def getEventDefaults(self):
79 ''' 80 Abstract method. Gets the names of events returned by L{getEventNames} that 81 will be buffered by default. 82 83 @return: Default event kinds to buffer 84 @rtype: list of string 85 @raise NotImplementedError: When this method is not overidden in a subclass 86 ''' 87 raise NotImplementedError
88
89 - def show(self, **kwargs):
90 ''' 91 Abstract method. Buffers the given key word arguments. It is up to the 92 monitor that implements this method to decide how to interpret and show the 93 given data. 94 95 @param kwargs: Information to buffer 96 @type kwargs: dictionary 97 @raise IOError: When the monitor is no longer accepting data to buffer 98 @raise NotImplementedError: When this method is not overidden in a subclass 99 ''' 100 raise NotImplementedError
101