Package translate :: Package storage :: Module txt :: Class TxtFile

[hide private]
[frames] | no frames]

# Class TxtFile

source code

This class represents a text file, made up of txtunits

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, flavour=None, encoding=`'``utf-8``'`) Constructs a blank TranslationStore. | source code

parse(self, lines) Read in text lines and create txtunits from the blocks of text | source code

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

getoutput(self) Convert the units back to blocks | source code

Inherited from `base.TranslationStore`: `__getstate__`, `__setstate__`, `add_unit_to_index`, `addsourceunit`, `addunit`, `detect_encoding`, `findid`, `findunit`, `findunits`, `getids`, `getprojectstyle`, `getsourcelanguage`, `gettargetlanguage`, `getunits`, `isempty`, `makeindex`, `remove_unit_from_index`, `require_index`, `save`, `savefile`, `setprojectstyle`, `setsourcelanguage`, `settargetlanguage`, `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 `base.TranslationStore`: `Extensions`, `Mimetypes`, `Name`, `suggestions_in_format` Inherited from `base.TranslationStore` (private): `_binary`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, inputfile=None, flavour=None, encoding=`'``utf-8``'`)
(Constructor)

source code

Constructs a blank TranslationStore.

Overrides: object.__init__
  (inherited documentation)

### parse(self, lines)

source code

Read in text lines and create txtunits from the blocks of text

Overrides: base.TranslationStore.parse

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

source code

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

Overrides: object.__str__
  (inherited documentation)