Package translate :: Package storage :: Module dtd :: Class dtdfile

[hide private]
[frames] | no frames]

# Class dtdfile

source code

this class represents a .dtd file, made up of dtdunits

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) construct a dtdfile, optionally reading in from inputfile | source code

parse(self, dtdsrc) read the source code of a dtd file in and include them as dtdunits in self.units | source code

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

getoutput(self) convert the units back to source | source code

makeindex(self) makes self.index dictionary keyed on entities | source code

Boolean

_valid_store(self) Validate the store to determine if it is valid | source code

Inherited from `base.TranslationStore`: `__getstate__`, `__setstate__`, `add_unit_to_index`, `addsourceunit`, `addunit`, `findid`, `findunit`, `findunits`, `getids`, `getsourcelanguage`, `gettargetlanguage`, `getunits`, `isempty`, `remove_unit_from_index`, `require_index`, `save`, `savefile`, `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)
(Constructor)

source code

construct a dtdfile, optionally reading in from inputfile

Overrides: object.__init__

### parse(self, dtdsrc)

source code

read the source code of a dtd file in and include them as dtdunits in self.units

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__

### makeindex(self)

source code

makes self.index dictionary keyed on entities

Overrides: base.TranslationStore.makeindex

### _valid_store(self)

source code

Validate the store to determine if it is valid

This uses ElementTree to parse the DTD

Returns: Boolean
  If the store passes validation