Package Pootle :: Package storage :: Module ddtp :: Class DDTPModule
[show private | hide private]
[frames | no frames]

Type DDTPModule

object --+
         |
        DDTPModule


A wrapper for a folder that stores DDTP translations.

Internally the strings are distributed among several modules in order to reduce the size of translation stores.

This class has methods to read/write data into either DDTP translation format or the Pootle database storage.
Method Summary
  __init__(self, folder)
  export_to_ddtp(self, translations_dir)
Export data from Pootle to DDTP.
  import_template(self, template)
Import DDTP description translations into Pootle.
  import_translations(self, translations)
Import DDTP description translations into Pootle.
  list_languages(self)
List all available languages.
  parse_template(self, f, charset)
Parse package descriptions from a Packages file.
  parse_translation(self, f, charset)
Parse a DDTP translation from a file.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
NoneType parsed_template = None                                                                  

Method Details

export_to_ddtp(self, translations_dir)

Export data from Pootle to DDTP.

`translations_dir` is the directory where to put Translation-?? files. If non-existent, it is created.

import_template(self, template)

Import DDTP description translations into Pootle.

import_translations(self, translations)

Import DDTP description translations into Pootle.

Overwrites old translations. TODO: do proper merging.

import_template() has to be invoked before calling this method.

template is a file-like object containing the descriptions (Packages). translations is a list of file-like objects which contain the translations (e.g., Translation-de).

list_languages(self)

List all available languages.

parse_template(self, f, charset='latin1')

Parse package descriptions from a Packages file.

Returns a list [(name, md5sum, description)].

`md5sum` is the MD5 checksum of the description.

parse_translation(self, f, charset='utf-8')

Parse a DDTP translation from a file.

Returns (lang, [(name, md5sum, description)]).

`md5sum` is the MD5 checksum of the description in English.

Class Variable Details

parsed_template

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Tue Aug 22 04:29:45 2006 http://epydoc.sf.net