Package translate :: Package storage :: Module cpo :: Class pofile

[hide private]
[frames] | no frames]

# Class pofile

source code

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, noheader=False) Constructs a blank TranslationStore. | source code

addunit(self, unit, new=True) Appends the given unit to the object's list of units. | source code

_insert_header(self, header) | source code

removeduplicates(self, duplicatestyle="merge") make sure each msgid is unique ; merge comments etc from duplicates into original | source code

__str__(self) Converts to a string representation that can be parsed back using parsestring(). | source code

isempty(self) Returns True if the object doesn't contain any translation units. | source code

parse(self, input) parser to process the given source string | source code

__del__(self) | source code

_free_iterator(self) | source code

Inherited from `poheader.poheader`: `getheaderplural`, `gettargetlanguage`, `header`, `makeheader`, `makeheaderdict`, `mergeheaders`, `parseheader`, `settargetlanguage`, `updatecontributor`, `updateheader`, `updateheaderplural`

Inherited from `base.TranslationStore`: `__getstate__`, `__setstate__`, `add_unit_to_index`, `addsourceunit`, `detect_encoding`, `findid`, `findunit`, `findunits`, `getids`, `getprojectstyle`, `getsourcelanguage`, `getunits`, `makeindex`, `remove_unit_from_index`, `require_index`, `save`, `savefile`, `setprojectstyle`, `setsourcelanguage`, `translate`, `unit_iter`

Inherited from `base.TranslationStore` (private): `_assignname`

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 `pocommon.pofile`: `Extensions`, `Mimetypes`, `Name` Inherited from `poheader.poheader`: `header_order`, `x_generator` Inherited from `base.TranslationStore`: `suggestions_in_format` Inherited from `base.TranslationStore` (private): `_binary`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

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

source code

Constructs a blank TranslationStore.

Overrides: object.__init__
  (inherited documentation)

### addunit(self, unit, new=True)

source code

Appends the given unit to the object's list of units.

This method should always be used rather than trying to modify the list manually.

Parameters:
  - `unit` - The unit that will be added.
Overrides: base.TranslationStore.addunit
  (inherited documentation)

### __str__(self)
(Informal representation operator)

source code

Converts to a string representation that can be parsed back using parsestring().

Overrides: object.__str__
  (inherited documentation)

### isempty(self)

source code

Returns True if the object doesn't contain any translation units.

Overrides: base.TranslationStore.isempty

### parse(self, input)

source code

parser to process the given source string

Overrides: base.TranslationStore.parse
  (inherited documentation)