Module pylupdate :: Class Context
[hide private]
[frames] | no frames]

Class Context

source code

object --+
         |
        Context

Wrapper for a translation context

Instance Methods [hide private]
 
__init__(self)
Instantiates a new Context object
source code
Message
__iter__(self)
Yields each Message object in the context
source code
 
__repr__(self)
repr(x)
source code
 
addMessage(self, msg)
Adds a message to the context.
source code
 
update(self, ctx)
Updates all current messages with data from another context (if contained).
source code
ElementTree.Element
toXml(self, name)
Creates the xml elements of the context
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
tuple(str, Context)
fromXml(elem)
Creates a context object from the xml element
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Instantiates a new Context object

Overrides: object.__init__

__iter__(self)

source code 

Yields each Message object in the context

Returns: Message
the message objects

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

addMessage(self, msg)

source code 

Adds a message to the context. If already exists, updates it.

Parameters:
  • msg (Message) - the message

update(self, ctx)

source code 

Updates all current messages with data from another context (if contained).

Parameters:
  • ctx (Context) - the other context

fromXml(elem)
Static Method

source code 

Creates a context object from the xml element

Parameters:
  • elem (ElementTree.Element) - the xml element
Returns: tuple(str, Context)
a tuple containing the name and the new context object

toXml(self, name)

source code 

Creates the xml elements of the context

Parameters:
  • name (str) - the name of the context
Returns: ElementTree.Element
the xml element