Package turbogears :: Package i18n :: Package pygettext :: Module pygettext

Module pygettext

source code


Version: 1.5

Classes
  TokenEater
Functions
 
usage(code, msg='') source code
 
make_escapes(pass_iso8859) source code
 
escape_ascii(s)
Escape all non-ascii text plus control chars and Python literals.
source code
 
escape_unicode(s)
Escape control chars and Python literals, leave non-ascii text intact.
source code
 
safe_eval(s) source code
 
normalize(s, escape=False) source code
 
containsAny(str, set)
Check whether 'str' contains ANY of the chars in 'set'
source code
 
getFilesForName(name)
Get a list of module files for a filename, a module or package name, or a directory.
source code
 
extract_genshi_strings(filename, options=None)
Extract translatable strings from a Genshi template.
source code
 
main() source code
Variables
  _ = lambda s:
  __doc__ = _("""pygettext -- Python equivalent of xgettext...
  kid_parser = None
hash(x)
  GenshiMarkupTemplate = None
hash(x)
  default_keywords = ['_']
  DEFAULTKEYWORDS = ', '.join(default_keywords)
  EMPTYSTRING = ''
  pot_header = _('...
  escapes = []
Function Details

extract_genshi_strings(filename, options=None)

source code 
Extract translatable strings from a Genshi template.

The extractor will get all the text inside all elements which are
not in the ignore list (see options) and the values of all
attributes named in the include list.

Options:

`ignore_tags` -- `'script style'`
    List of element names. Content inside elements named in
    this list is not extracted as translatable text. Can be a
    space-separated string or a list of string.
`include_attrs` -- `'abbr alt label prompt standby summary title'`
    List of attribute names. Only values of the attributes named in this
    list are extracted as translatable text. Can be a space-separated
    string or a list of string.

See http://genshi.edgewall.org/wiki/Documentation/0.5.x/i18n.html for
more information.


Variables Details

__doc__

Value:
_("""pygettext -- Python equivalent of xgettext(1)

Many systems (Solaris, Linux, Gnu) provide extensive tools that ease t\
he
internationalization of C programs. Most of these tools are independen\
t of
the programming language and can be used from within Python programs.
Martin von Loewis' work[1] helps considerably in this regard.
...

pot_header

Value:
_('''\
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\\n"
...