Package translate :: Package storage :: Module qph :: Class QphFile

[hide private]
[frames] | no frames]

# Class QphFile

source code

               object --+
                        |
    base.TranslationStore --+
                            |
                lisa.LISAfile --+
                                |
                               QphFile

Class representing a QPH file store.

Nested Classes | [hide private]

| UnitClass A single term in the qph file.

Instance Methods | [hide private]

__init__(self, *args, **kwargs) Constructs a blank TranslationStore. | source code

initbody(self) Initialises self.body. | source code

createcontext(self, contextname, comment=None) Creates a context node with an optional comment | source code

getcontextname(self, contextnode) Returns the name of the given context. | source code

getcontextnames(self) Returns all contextnames in this TS file. | source code

getcontextnode(self, contextname) Finds the contextnode with the given name. | source code

addunit(self, unit, new=True, contextname=None, createifmissing=False) adds the given trans-unit to the last used body node if the contextname has changed it uses the slow method instead (will create the nodes required if asked). | source code

switchcontext(self, contextname, createifmissing=False) Switch the current context to the one named contextname, optionally creating it if it doesn't exist. | source code

Inherited from `lisa.LISAfile`: `__str__`, `addheader`, `addsourceunit`, `namespaced`, `parse`, `setsourcelanguage`, `settargetlanguage`

Inherited from `base.TranslationStore`: `findunit`, `getunits`, `isempty`, `makeindex`, `save`, `savefile`, `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]

| Name = ``'``Qt Phrase Book File``'``
| Mimetypes = ``[``'``application/x-qph``'``]``
| Extensions = ``[``'``qph``'``]``
| rootNode = ``'``QPH``'``
| bodyNode = ``'``context``'``
| XMLskeleton = ``'``<!DOCTYPE QPH>\n<QPH>\n</QPH>\n``'``
| namespace = ``'````'``

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, *args, **kwargs)
(Constructor)

source code

Constructs a blank TranslationStore.

Overrides: object.__init__
  (inherited documentation)

### initbody(self)

source code

Initialises self.body.

Overrides: lisa.LISAfile.initbody

### addunit(self, unit, new=True, contextname=None, createifmissing=False)

source code

adds the given trans-unit to the last used body node if the contextname has changed it uses the slow method instead (will create the nodes required if asked). Returns success

Parameters:
  - `unit` - The unit that will be added.
Overrides: base.TranslationStore.addunit