Home | Trees | Indices | Help |
---|
|
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/some-very-long-filename-that-should-not-be-wrapped-even-if-it-is-larger-than-the-wrap-limit.c', 32), ('src/eggs.c', 45)] >>> entry.comment = 'A plural translation. This is a very very very long line please do not wrap, this is just for testing comment wrapping...' >>> entry.tcomment = 'A plural translation. This is a very very very long line please do not wrap, this is just for testing comment wrapping...' >>> 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. This is a very very very long line please do not #. wrap, this is just for testing comment wrapping... # A plural translation. This is a very very very long line please do not wrap, # this is just for testing comment wrapping... #: src/some-very-long-filename-that-should-not-be-wrapped-even-if-it-is-larger-than-the-wrap-limit.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>
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
POEntry constructor.
|
Return the string representation of the entry.
|
Called by comparison operations if rich comparison is not defined. **Tests**: >>> a = POEntry(msgid='a', occurrences=[('b.py', 1), ('b.py', 3)]) >>> b = POEntry(msgid='b', occurrences=[('b.py', 1), ('b.py', 3)]) >>> c1 = POEntry(msgid='c1', occurrences=[('a.py', 1), ('b.py', 1)]) >>> c2 = POEntry(msgid='c2', occurrences=[('a.py', 1), ('a.py', 3)]) >>> po = POFile() >>> po.append(a) >>> po.append(b) >>> po.append(c1) >>> po.append(c2) >>> po.sort() >>> print(po) # msgid "" msgstr "" <BLANKLINE> #: a.py:1 a.py:3 msgid "c2" msgstr "" <BLANKLINE> #: a.py:1 b.py:1 msgid "c1" msgstr "" <BLANKLINE> #: b.py:1 b.py:3 msgid "a" msgstr "" <BLANKLINE> #: b.py:1 b.py:3 msgid "b" msgstr "" <BLANKLINE> |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Mar 1 13:19:32 2009 | http://epydoc.sourceforge.net |