Package translate :: Package storage :: Module pypo :: Class pofile
[hide private]
[frames] | no frames]

Class pofile

source code


this represents a .po file containing various units

Nested Classes [hide private]
  UnitClass
The class of units that will be instantiated and used by this class
Instance Methods [hide private]
 
__init__(self, inputfile=None, encoding=None, unitclass=pounit)
construct a pofile, optionally reading in from inputfile.
source code
 
changeencoding(self, newencoding)
Deprecated: changes the encoding on the file.
source code
 
parse(self, input)
parses the given file or file source string
source code
 
removeduplicates(self, duplicatestyle="merge")
make sure each msgid is unique ; merge comments etc from duplicates into original
source code
 
__str__(self)
convert to a string.
source code
 
_getoutput(self)
convert the units back to lines
source code
 
encode(self, lines)
encode any unicode strings in lines in self._encoding
source code
 
decode(self, lines)
decode any non-unicode strings in lines with self._encoding
source code
 
unit_iter(self)
Iterator over all the units in this store.
source code

Inherited from pocommon.pofile: makeheader

Inherited from base.TranslationStore: __getstate__, __setstate__, add_unit_to_index, addsourceunit, addunit, findunit, findunits, getsourcelanguage, gettargetlanguage, getunits, isempty, makeindex, remove_unit_from_index, require_index, save, savefile, setsourcelanguage, settargetlanguage, translate

Inherited from base.TranslationStore (private): _assignname

Inherited from poheader.poheader: getheaderplural, header, makeheaderdict, mergeheaders, parseheader, updatecontributor, updateheader, updateheaderplural

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

Class Methods [hide private]

Inherited from base.TranslationStore: parsefile, parsestring

Class Variables [hide private]

Inherited from base.TranslationStore: Extensions, Mimetypes, Name, suggestions_in_format

Inherited from base.TranslationStore (private): _binary

Inherited from poheader.poheader: header_order, x_generator

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, inputfile=None, encoding=None, unitclass=pounit)
(Constructor)

source code 

construct a pofile, optionally reading in from inputfile. encoding can be specified but otherwise will be read from the PO header

Overrides: object.__init__

parse(self, input)

source code 

parses the given file or file source string

Overrides: base.TranslationStore.parse

__str__(self)
(Informal representation operator)

source code 

convert to a string. double check that unicode is handled somehow here

Overrides: object.__str__

unit_iter(self)

source code 

Iterator over all the units in this store.

Overrides: base.TranslationStore.unit_iter
(inherited documentation)