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 --+
                                          |
                      i18n.FancyEqMixin --+
                                          |
                                         Message

I am a message to be shown in a UI.

Projects should subclass this base class to provide default project and version class attributes.

Instance Methods [hide private]
 
__init__(self, level, translatable, debug=None, id=None, priority=50, timestamp=None, mid=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 i18n.FancyEqMixin: __eq__, __ne__

Class Variables [hide private]
  project = 'flumotion'
  version = '0.5.2.1'
  compareAttributes = ['level', 'translatables', 'debug', 'mid',...

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

Instance Variables [hide private]
str section = None
name of the section in which the message is described.
str anchor = None
name of the anchor in which the message is described.
flumotion.common.messages.Translatable description = None
the link text to show
Method Details [hide private]

__init__(self, level, translatable, debug=None, id=None, priority=50, timestamp=None, mid=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.
  • mid - 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', 'mid', 'priority', 'timestamp']