Package translate :: Package storage :: Module qph :: Class QphFile
[hide private]
[frames] | no frames]

Class QphFile

source code


Class representing a QPH file store.

Nested Classes [hide private]
  UnitClass
The class of units that will be instantiated and used by this class
Instance Methods [hide private]
 
initbody(self)
Initialises self.body so it never needs to be retrieved from the XML again.
source code
 
__str__(self)
Converts to a string containing the file's XML.
source code

Inherited from lisa.LISAfile: __init__, addheader, addsourceunit, addunit, namespaced, parse

Inherited from base.TranslationStore: __getstate__, __setstate__, add_unit_to_index, findid, findunit, findunits, getids, getsourcelanguage, gettargetlanguage, getunits, isempty, makeindex, 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]
  Name = _("Qt Phrase Book")
The human usable name of this store type
  Mimetypes = ["application/x-qph"]
A list of MIME types associated with this store type
  Extensions = ["qph"]
A list of file extentions associated with this store type
  rootNode = "QPH"
  bodyNode = "QPH"
  XMLskeleton = '''<!DOCTYPE Q...
  namespace = ''
Parse an instance of this class from the start of the given string.

Inherited from base.TranslationStore: suggestions_in_format

Inherited from base.TranslationStore (private): _binary

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

initbody(self)

source code 

Initialises self.body so it never needs to be retrieved from the XML again.

Overrides: lisa.LISAfile.initbody

__str__(self)
(Informal representation operator)

source code 

Converts to a string containing the file's XML.

We have to override this to ensure mimic the Qt convention:

  • no XML decleration
  • plain DOCTYPE that lxml seems to ignore
Overrides: object.__str__

Class Variable Details [hide private]

XMLskeleton

Value:
'''<!DOCTYPE QPH>
<QPH>
</QPH>
'''