Package muntjac :: Package terminal :: Module error_message
[hide private]
[frames] | no frames]

Source Code for Module muntjac.terminal.error_message

 1  # Copyright (C) 2012 Vaadin Ltd.  
 2  # Copyright (C) 2012 Richard Lincoln 
 3  #  
 4  # Licensed under the Apache License, Version 2.0 (the "License");  
 5  # you may not use this file except in compliance with the License.  
 6  # You may obtain a copy of the License at  
 7  #  
 8  #     http://www.apache.org/licenses/LICENSE-2.0  
 9  #  
10  # Unless required by applicable law or agreed to in writing, software  
11  # distributed under the License is distributed on an "AS IS" BASIS,  
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13  # See the License for the specific language governing permissions and  
14  # limitations under the License. 
15   
16  """Interface for rendering error messages to terminal.""" 
17   
18  from muntjac.terminal.paintable import IPaintable 
19   
20   
21 -class IErrorMessage(IPaintable):
22 """Interface for rendering error messages to terminal. All the 23 visible errors shown to user must implement this interface. 24 25 @author: Vaadin Ltd. 26 @author: Richard Lincoln 27 @version: 1.1.2 28 """ 29 30 #: Error code for system errors and bugs. 31 SYSTEMERROR = 5000 32 33 #: Error code for critical error messages. 34 CRITICAL = 4000 35 36 #: Error code for regular error messages. 37 ERROR = 3000 38 39 #: Error code for warning messages. 40 WARNING = 2000 41 42 #: Error code for informational messages. 43 INFORMATION = 1000 44
45 - def getErrorLevel(self):
46 """Gets the errors level. 47 48 @return: the level of error as an integer. 49 """ 50 raise NotImplementedError
51 52
53 - def addListener(self, listener, iface=None):
54 """Error messages are unmodifiable and thus listeners are not needed. 55 This method should be implemented as empty. 56 57 @param listener: 58 the listener to be added. 59 @see: L{IPaintable.addListener} 60 """ 61 raise NotImplementedError
62 63
64 - def addCallback(self, callback, eventType=None, *args):
65 raise NotImplementedError
66 67
68 - def removeListener(self, listener, iface=None):
69 """Error messages are inmodifiable and thus listeners are not needed. 70 This method should be implemented as empty. 71 72 @param listener: 73 the listener to be removed. 74 @see: L{IPaintable.removeListener} 75 """ 76 raise NotImplementedError
77 78
79 - def removeCallback(self, callback, eventType=None):
80 raise NotImplementedError
81 82
83 - def requestRepaint(self):
84 """Error messages are inmodifiable and thus listeners are not needed. 85 This method should be implemented as empty. 86 87 @see: L{IPaintable.requestRepaint} 88 """ 89 raise NotImplementedError
90