Home | Trees | Indices | Help |
---|
|
object --+ | list --+ | _BaseFile --+ | POFile
Po (or Pot) file reader/writer. POFile objects inherit the list objects methods.
**Example**:>>> po = POFile() >>> entry1 = POEntry( ... msgid="Some english text", ... msgstr="Un texte en anglais" ... ) >>> entry1.occurrences = [('testfile', 12),('another_file', 1)] >>> entry1.comment = "Some useful comment" >>> entry2 = POEntry( ... msgid="I need my dirty cheese", ... msgstr="Je veux mon sale fromage" ... ) >>> entry2.occurrences = [('testfile', 15),('another_file', 5)] >>> entry2.comment = "Another useful comment" >>> entry3 = POEntry( ... msgid='Some entry with quotes " \"', ... msgstr=u'Un message unicode avec des quotes " \"' ... ) >>> entry3.comment = "Test string quoting" >>> po.append(entry1) >>> po.append(entry2) >>> po.append(entry3) >>> po.header = "Some Header" >>> print po # Some Header msgid "" msgstr "" <BLANKLINE> #. Some useful comment #: testfile:12 another_file:1 msgid "Some english text" msgstr "Un texte en anglais" <BLANKLINE> #. Another useful comment #: testfile:15 another_file:5 msgid "I need my dirty cheese" msgstr "Je veux mon sale fromage" <BLANKLINE> #. Test string quoting msgid "Some entry with quotes \" \"" msgstr "Un message unicode avec des quotes \" \"" <BLANKLINE>
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
|
Save the binary representation of the file to *fpath*. **Keyword arguments**:
|
Convenience method that return the percentage of translated messages. **Example**:>>> import polib >>> po = polib.pofile('tests/test_pofile_helpers.po') >>> po.percent_translated() 50 |
Convenience method that return a list of translated entries. **Example**:>>> import polib >>> po = polib.pofile('tests/test_pofile_helpers.po') >>> len(po.translated_entries()) 5 |
Convenience method that return a list of untranslated entries. **Example**:>>> import polib >>> po = polib.pofile('tests/test_pofile_helpers.po') >>> len(po.untranslated_entries()) 5 |
Convenience method that return the list of 'fuzzy' entries. **Example**:>>> import polib >>> po = polib.pofile('tests/test_pofile_helpers.po') >>> len(po.fuzzy_entries()) 2 |
Convenience method that return the list of obsolete entries. **Example**:>>> import polib >>> po = polib.pofile('tests/test_pofile_helpers.po') >>> len(po.obsolete_entries()) 4 |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Tue Dec 11 12:11:51 2007 | http://epydoc.sourceforge.net |