Module polib :: Class POEntry
[hide private]
[frames] | no frames]

Class POEntry

source code

object --+    
         |    
_BaseEntry --+
             |
            POEntry

Represents a po file entry.

**Examples**:
>>> entry = POEntry(msgid='Welcome', msgstr='Bienvenue')
>>> entry.occurrences = [('welcome.py', 12), ('anotherfile.py', 34)]
>>> print entry
#: welcome.py:12 anotherfile.py:34
msgid "Welcome"
msgstr "Bienvenue"
<BLANKLINE>
>>> entry = POEntry()
>>> entry.occurrences = [('src/spam.c', 32), ('src/eggs.c', 45)]
>>> entry.tcomment = 'A plural translation'
>>> entry.flags.append('c-format')
>>> entry.msgid = 'I have spam but no egg !'
>>> entry.msgid_plural = 'I have spam and %d eggs !'
>>> entry.msgstr_plural[0] = "J'ai du jambon mais aucun oeuf !"
>>> entry.msgstr_plural[1] = "J'ai du jambon et %d oeufs !"
>>> print entry
# A plural translation
#: src/spam.c:32 src/eggs.c:45
#, c-format
msgid "I have spam but no egg !"
msgid_plural "I have spam and %d eggs !"
msgstr[0] "J'ai du jambon mais aucun oeuf !"
msgstr[1] "J'ai du jambon et %d oeufs !"
<BLANKLINE>


Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
POEntry constructor.
source code
 
__str__(self, wrapwidth=78)
Return the string representation of the entry.
source code
 
translated(self)
Return True if the entry has been translated or False
source code
 
__getattr__(self, name) source code
 
__setattr__(self, name, value)
x.__setattr__('name', value) <==> x.name = value
source code

Inherited from _BaseEntry: __repr__

Inherited from _BaseEntry (private): _decode, _str_field

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
POEntry constructor.
Overrides: _BaseEntry.__init__

__str__(self, wrapwidth=78)
(Informal representation operator)

source code 
Return the string representation of the entry.
Overrides: _BaseEntry.__str__

__setattr__(self, name, value)

source code 
x.__setattr__('name', value) <==> x.name = value
Overrides: object.__setattr__
(inherited documentation)