Package translate :: Package storage :: Module pypo |
[hide private]
[frames] | no frames]

# Module pypo

source code

classes that hold units of .po files (pounit) or entire files (pofile) gettext-style .po (or .pot) files are used in translations for KDE et al (see kbabel)

Classes | [hide private]
| pounit
| pofile A .po file containing various units

Functions | [hide private]
escapeforpo(line) Escapes a line for po format. | source code
unescapehandler(escape) | source code
wrapline(line) Wrap text for po files. | source code
quoteforpo(text) quotes the given text for a PO file, returning quoted and escaped lines | source code
extractpoline(line) Remove quote and unescape line from po file. | source code
unquotefrompo(postr) | source code
encodingToUse(encoding) Tests whether the given encoding is known in the python runtime, or returns utf-8. | source code
is_null(lst) | source code
extractstr(string) | source code

Variables | [hide private]
| lsep = `"\n#: "` Seperator for #: entries
| po_unescape_map = `{"\\r": "\r", "\\t": "\t", '\\"': '"', '\\n'`...``
| po_escape_map = `dict([(value, key) for(key, value) in po_unesc`...``

Imports: multistring, quote, textwrap, data, pocommon, base, re, copy, cStringIO, poparser

Function Details | [hide private]

### escapeforpo(line) | source code
Escapes a line for po format. assumes no occurs in the line. Parameters: `line` - unescaped text

### extractpoline(line) | source code
Remove quote and unescape line from po file. Parameters: `line` - a quoted line from a po file (msgid or msgstr)

### encodingToUse(encoding) | source code
Tests whether the given encoding is known in the python runtime, or returns utf-8. This function is used to ensure that a valid encoding is always used.

Variables Details | [hide private]

  ### po_unescape_map Value:
      {"\\r": "\r", "\\t": "\t", '\\"': '"', '\\n': '\n', '\\\\': '\\'}

  ### po_escape_map Value:
      dict([(value, key) for(key, value) in po_unescape_map.items()])