Package translate :: Package storage :: Module dtd :: Class dtdunit

[hide private]
[frames] | no frames]

# Class dtdunit

source code

              object --+
                       |
    base.TranslationUnit --+
                           |
                          dtdunit

this class represents an entity definition from a dtd file (and possibly associated comments)

Instance Methods | [hide private]

__init__(self, source=`'````'`) construct the dtdunit, prepare it for parsing | source code

isnull(self) returns whether this dtdunit doesn't actually have an entity definition | source code

parse(self, dtdsrc) read the first dtd element from the source code into this object, return linesprocessed | source code

__str__(self) convert to a string. | source code

getoutput(self) convert the dtd entity back to string form | 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
Inherited from `base.TranslationUnit`: `addlocation`, `addlocations`, `getlocations`
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=`'````'`)
(Constructor)

source code

construct the dtdunit, prepare it for parsing

Overrides: object.__init__

### settarget(self, target)

source code

Sets the definition to the quoted value of target

Overrides: base.TranslationUnit.settarget

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

source code

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

Overrides: object.__str__

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