Package flumotion :: Package common :: Module messages :: Class Message
[hide private]

Class Message

source code

 twisted.spread.jelly.Jellyable --+        
                                  |        
twisted.spread.flavors.Serializable --+    
                                      |    
        twisted.spread.flavors.Copyable --+
                                          |
   twisted.spread.jelly.Unjellyable --+   |
                                      |   |
      twisted.spread.flavors.RemoteCopy --+
                                          |
                           FancyEqMixin --+
                                          |
                                         Message

I am a message to be shown in a UI.

Instance Methods [hide private]
 
__init__(self, level, translatable, debug=None, id=None, priority=50, timestamp=None)
Create a new message.
source code
 
__repr__(self) source code
 
add(self, translatable) source code

Inherited from twisted.spread.flavors.Copyable: getStateToCopy, getStateToCopyFor, getTypeToCopy, getTypeToCopyFor, jellyFor

Inherited from twisted.spread.flavors.Serializable: processUniqueID

Inherited from twisted.spread.jelly.Jellyable: __providedBy__, getStateFor

Inherited from twisted.spread.flavors.RemoteCopy: setCopyableState, unjellyFor

Inherited from twisted.spread.jelly.Unjellyable: setStateFor

Inherited from FancyEqMixin: __eq__, __ne__

Class Variables [hide private]
  compareAttributes = ['level', 'translatables', 'debug', 'id', ...

Inherited from twisted.spread.flavors.Copyable: __implemented__, __provides__

Method Details [hide private]

__init__(self, level, translatable, debug=None, id=None, priority=50, timestamp=None)
(Constructor)

source code 

Create a new message.

The id identifies this kind of message, and serves two purposes.

The first purpose is to serve as a key by which a kind of message might be removed from a set of messages. For example, a firewire component detecting that a cable has been plugged in will remove any message that the cable is unplugged.

Secondly it serves so that the message viewers that watch the 'current state' of some object only see the latest message of a given type. For example when messages are stored in persistent state objects that can be transferred over the network, it becomes inefficient to store the whole history of status messages. Message stores can keep only the latest message of a given ID.

Parameters:
  • level - ERROR, WARNING or INFO
  • translatable - a translatable possibly with markup for linking to documentation or running commands.
  • debug - further, untranslated, debug information, not always shown
  • priority - priority compared to other messages of the same level
  • timestamp - time since epoch at which the message was generated, in seconds.
  • id - A unique id for this kind of message, as discussed above. If not given, will be generated from the contents of the translatable.

Class Variable Details [hide private]

compareAttributes

Value:
['level', 'translatables', 'debug', 'id', 'priority', 'timestamp']