Package translate :: Package storage :: Module txt :: Class TxtUnit

[hide private]
[frames] | no frames]

# Class TxtUnit

source code

              object --+
                       |
    base.TranslationUnit --+
                           |
                          TxtUnit

This class represents a block of text from a text file

Instance Methods | [hide private]

__init__(self, source=`'````'`, encoding=`'``utf-8``'`) Construct the txtunit | source code

__str__(self) Convert a txt unit to a string | source code

Inherited from `base.TranslationUnit`: `__eq__`, `getcontext`, `getid`, `getunits`, `hasplural`, `isblank`, `isfuzzy`, `isheader`, `isreview`, `istranslatable`, `istranslated`, `markfuzzy`, `markreviewneeded`, `merge`, `unit_iter` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`
Source

setsource(self, source) Sets the definition to the quoted value of source | source code

getsource(self) gets the unquoted source string | source code

Inherited from `base.TranslationUnit`: `getsourcelanguage`
Target

settarget(self, target) Sets the definition to the quoted value of target | source code

gettarget(self) gets the unquoted target string | source code

Inherited from `base.TranslationUnit`: `gettargetlanguage`, `gettargetlen`
Notes
Inherited from `base.TranslationUnit`: `addnote`, `getnotes`, `removenotes`
Locations

addlocation(self, location) Add one location to the list of locations. | source code

List

getlocations(self) A list of source code locations. | source code

Inherited from `base.TranslationUnit`: `addlocations`
Errors
Inherited from `base.TranslationUnit`: `adderror`, `geterrors`

Class Methods | [hide private]

Inherited from `base.TranslationUnit`: `buildfromunit`

Properties | [hide private]

Inherited from `object`: `__class__`
Source
| source gets the unquoted source string
Target
| target gets the unquoted target string

Method Details | [hide private]

### __init__(self, source=`'````'`, encoding=`'``utf-8``'`)
(Constructor)

source code

Construct the txtunit

Overrides: object.__init__

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

source code

Convert a txt unit to a string

Overrides: object.__str__

### settarget(self, target)

source code

Sets the definition to the quoted value of target

Overrides: base.TranslationUnit.settarget

### addlocation(self, location)

source code

Add one location to the list of locations.

Overrides: base.TranslationUnit.addlocation
  (inherited documentation)

### getlocations(self)

source code

A list of source code locations.

Returns: List
Overrides: base.TranslationUnit.getlocations
  (inherited documentation)

Property Details | [hide private]

### source

gets the unquoted source string

Get Method:
  getsource(self) - gets the unquoted source string
Set Method:
  setsource(self, source) - Sets the definition to the quoted value of source

### target

gets the unquoted target string

Get Method:
  gettarget(self) - gets the unquoted target string
Set Method:
  settarget(self, target) - Sets the definition to the quoted value of target