pygettext2.7(1) - phpMan
PYGETTEXT(1) General Commands Manual PYGETTEXT(1)
pygettext - Python equivalent of xgettext(1)
pygettext [OPTIONS] INPUTFILE ...
pygettext is deprecated. The current version of xgettext supports many languages, includ‐
pygettext uses Python's standard tokenize module to scan Python source code, generating
.pot files identical to what GNU xgettext generates for C and C++ code. From there, the
standard GNU tools can be used.
pygettext searches only for _() by default, even though GNU xgettext recognizes the fol‐
lowing keywords: gettext, dgettext, dcgettext, and gettext_noop. See the -k/--keyword flag
below for how to augment this.
Extract all strings.
Rename the default output file from messages.pot to name.pot.
Replace non-ASCII characters with octal escape sequences.
Extract module, class, method, and function docstrings. These do not need to be
wrapped in _() markers, and in fact cannot be for Python to consider them doc‐
strings. (See also the -X option).
Print this help message and exit.
Keywords to look for in addition to the default set, which are: _
You can have multiple -k flags on the command line.
Disable the default set of keywords (see above). Any keywords explicitly added
with the -k/--keyword option are still recognized.
Do not write filename/lineno location comments.
Write filename/lineno location comments indicating where each extracted string is
found in the source. These lines appear before each msgid. The style of comments
is controlled by the -S/--style option. This is the default.
Rename the default output file from messages.pot to FILENAME. If FILENAME is `-'
then the output is sent to standard out.
Output files will be placed in directory DIR.
Specify which style to use for location comments. Two styles are supported:
· Solaris # File: filename, line: line-number
· GNU #: filename:line
The style name is case insensitive. GNU style is the default.
Print the names of the files being processed.
Print the version of pygettext and exit.
Set width of output to columns.
Specify a file that contains a list of strings that are not be extracted from the
input files. Each string to be excluded must appear on a line by itself in the
Specify a file that contains a list of files (one per line) that should not have
their docstrings extracted. This is only useful in conjunction with the -D option
If `INPUTFILE' is -, standard input is read.
pygettext attempts to be option and feature compatible with GNU xgettext where ever possi‐
ble. However some options are still missing or are not fully implemented. Also, xget‐
text's use of command line switches with option arguments is broken, and in these cases,
pygettext just defines additional switches.
pygettext is written by Barry Warsaw <barry AT zope.com>.
Joonas Paalasmaa <joonas.paalasmaa AT iki.fi> put this manual page together based on "pyget‐
pygettext 1.4 PYGETTEXT(1)