polib.POEntry

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

# Class POEntry

source code

    _BaseEntry --+
                 |
                POEntry

Represents a po file entry.

Examples:

    >>> entry = POEntry(msgid='Welcome', msgstr='Bienvenue')
    >>> entry.occurences = [('welcome.py', 12), ('anotherfile.py', 34)]
    >>> print entry
    #: welcome.py:12 anotherfile.py:34
    msgid "Welcome"
    msgstr "Bienvenue"
    <BLANKLINE>
    >>> entry = POEntry()
    >>> entry.occurences = [('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
Inherited from `_BaseEntry`: `__repr__` Inherited from `_BaseEntry` (private): `_decode`, `_str_field`

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__