140 lines
5.2 KiB
HTML
140 lines
5.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of PYGETTEXT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>PYGETTEXT</H1>
|
|
Section: User Commands (1)<BR>Updated: <BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
pygettext - Python equivalent of <A HREF="/cgi-bin/man/man2html?1+xgettext">xgettext</A>(1)
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<B>pygettext</B>
|
|
|
|
[<I>OPTIONS</I>] <I>INPUTFILE </I>...
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
pygettext is deprecated. The current version of xgettext supports
|
|
many languages, including Python.
|
|
<P>
|
|
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.
|
|
<P>
|
|
|
|
pygettext searches only for _() by default, even though GNU xgettext
|
|
recognizes the following keywords: gettext, dgettext, dcgettext,
|
|
and gettext_noop. See the <B>-k</B>/<B>--keyword</B> flag below for how to
|
|
augment this.
|
|
<P>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-a</B>, <B>--extract-all</B><DD>
|
|
Extract all strings.
|
|
<DT id="2"><B>-d</B>, <B>--default-domain</B>=<I>NAME</I><DD>
|
|
Rename the default output file from messages.pot to name.pot.
|
|
<DT id="3"><B>-E</B>, <B>--escape</B><DD>
|
|
Replace non-ASCII characters with octal escape sequences.
|
|
<DT id="4"><B>-D</B>, <B>--docstrings</B><DD>
|
|
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 docstrings. (See also the <B>-X</B> option).
|
|
<DT id="5"><B>-h</B>, <B>--help</B><DD>
|
|
Print this help message and exit.
|
|
<DT id="6"><B>-k</B>, <B>--keyword</B>=<I>WORD</I><DD>
|
|
Keywords to look for in addition to the default set, which are: _
|
|
<DT id="7"><DD>
|
|
You can have multiple <B>-k</B> flags on the command line.
|
|
<DT id="8"><B>-K</B>, <B>--no-default-keywords</B><DD>
|
|
Disable the default set of keywords (see above).
|
|
Any keywords explicitly added with the <B>-k</B>/<B>--keyword</B> option
|
|
are still recognized.
|
|
<DT id="9"><B>--no-location</B><DD>
|
|
Do not write filename/lineno location comments.
|
|
<DT id="10"><B>-n</B>, <B>--add-location</B><DD>
|
|
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
|
|
<B>-S</B>/<B>--style</B> option. This is the default.
|
|
<DT id="11"><B>-o</B>, <B>--output</B>=<I>FILENAME</I><DD>
|
|
Rename the default output file from messages.pot to FILENAME.
|
|
If FILENAME is `-' then the output is sent to standard out.
|
|
<DT id="12"><B>-p</B>, <B>--output-dir</B>=<I>DIR</I><DD>
|
|
Output files will be placed in directory DIR.
|
|
<DT id="13"><B>-S</B>, <B>--style</B>=<I>STYLENAME</I><DD>
|
|
Specify which style to use for location comments.
|
|
Two styles are supported:
|
|
<DL COMPACT><DT id="14"><DD>
|
|
<DL COMPACT>
|
|
<DT id="15">•<DD>
|
|
Solaris<TT> </TT># File: filename, line: line-number<BR>
|
|
<DT id="16">•<DD>
|
|
GNU<TT> </TT><TT> </TT>#: filename:line<BR>
|
|
</DL>
|
|
</DL>
|
|
|
|
<DT id="17"><DD>
|
|
The style name is case insensitive.
|
|
GNU style is the default.
|
|
<DT id="18"><B>-v</B>, <B>--verbose</B><DD>
|
|
Print the names of the files being processed.
|
|
<DT id="19"><B>-V</B>, <B>--version</B><DD>
|
|
Print the version of pygettext and exit.
|
|
<DT id="20"><B>-w</B>, <B>--width</B>=<I>COLUMNS</I><DD>
|
|
Set width of output to columns.
|
|
<DT id="21"><B>-x</B>, <B>--exclude-file</B>=<I>FILENAME</I><DD>
|
|
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 file.
|
|
<DT id="22"><B>-X</B>, <B>--no-docstrings</B>=<I>FILENAME</I><DD>
|
|
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 <B>-D</B> option above.
|
|
</DL>
|
|
<P>
|
|
|
|
If `INPUTFILE' is -, standard input is read.
|
|
<A NAME="lbAF"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
pygettext attempts to be option and feature compatible with GNU xgettext
|
|
where ever possible. However some options are still missing or are not fully
|
|
implemented. Also, xgettext's use of command line switches with option
|
|
arguments is broken, and in these cases, pygettext just defines additional
|
|
switches.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
pygettext is written by Barry Warsaw <<A HREF="mailto:barry@zope.com">barry@zope.com</A>>.
|
|
<P>
|
|
|
|
Joonas Paalasmaa <<A HREF="mailto:joonas.paalasmaa@iki.fi">joonas.paalasmaa@iki.fi</A>> put this manual page together
|
|
based on "pygettext --help".
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="23"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="24"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="25"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="26"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="27"><A HREF="#lbAF">BUGS</A><DD>
|
|
<DT id="28"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:26 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|