aboutsummaryrefslogtreecommitdiff
path: root/examples/python2.7/debian/pygettext.1
blob: 114016798fda2465df318d8543db0deb1c29e514 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.TH PYGETTEXT 1 "" "pygettext 1.4"
.SH NAME
pygettext \- Python equivalent of xgettext(1)
.SH SYNOPSIS
.B pygettext
[\fIOPTIONS\fR] \fIINPUTFILE \fR...
.SH DESCRIPTION
pygettext is deprecated. The current version of xgettext supports
many languages, including Python.

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.
.PP
pygettext searches only for _() by default, even though GNU xgettext
recognizes the following keywords: gettext, dgettext, dcgettext,
and gettext_noop. See the \fB\-k\fR/\fB\--keyword\fR flag below for how to
augment this.
.PP
.SH OPTIONS
.TP
\fB\-a\fR, \fB\-\-extract\-all\fR
Extract all strings.
.TP
\fB\-d\fR, \fB\-\-default\-domain\fR=\fINAME\fR
Rename the default output file from messages.pot to name.pot.
.TP
\fB\-E\fR, \fB\-\-escape\fR
Replace non-ASCII characters with octal escape sequences.
.TP
\fB\-D\fR, \fB\-\-docstrings\fR
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 \fB\-X\fR option).
.TP
\fB\-h\fR, \fB\-\-help\fR
Print this help message and exit.
.TP
\fB\-k\fR, \fB\-\-keyword\fR=\fIWORD\fR
Keywords to look for in addition to the default set, which are: _
.IP
You can have multiple \fB\-k\fR flags on the command line.
.TP
\fB\-K\fR, \fB\-\-no\-default\-keywords\fR
Disable the default set of keywords (see above).
Any keywords explicitly added with the \fB\-k\fR/\fB\--keyword\fR option
are still recognized.
.TP
\fB\-\-no\-location\fR
Do not write filename/lineno location comments.
.TP
\fB\-n\fR, \fB\-\-add\-location\fR
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
\fB\-S\fR/\fB\--style\fR option.  This is the default.
.TP
\fB\-o\fR, \fB\-\-output\fR=\fIFILENAME\fR
Rename the default output file from messages.pot to FILENAME.
If FILENAME is `-' then the output is sent to standard out.
.TP
\fB\-p\fR, \fB\-\-output\-dir\fR=\fIDIR\fR
Output files will be placed in directory DIR.
.TP
\fB\-S\fR, \fB\-\-style\fR=\fISTYLENAME\fR
Specify which style to use for location comments.
Two styles are supported:
.RS
.IP \(bu 4
Solaris	# File: filename, line: line-number
.IP \(bu 4
GNU		#: filename:line
.RE
.IP
The style name is case insensitive.
GNU style is the default.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print the names of the files being processed.
.TP
\fB\-V\fR, \fB\-\-version\fR
Print the version of pygettext and exit.
.TP
\fB\-w\fR, \fB\-\-width\fR=\fICOLUMNS\fR
Set width of output to columns.
.TP
\fB\-x\fR, \fB\-\-exclude\-file\fR=\fIFILENAME\fR
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.
.TP
\fB\-X\fR, \fB\-\-no\-docstrings\fR=\fIFILENAME\fR
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 \fB\-D\fR option above.
.PP
If `INPUTFILE' is -, standard input is read.
.SH BUGS
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.
.SH AUTHOR
pygettext is written by Barry Warsaw <barry@zope.com>.
.PP
Joonas Paalasmaa <joonas.paalasmaa@iki.fi> put this manual page together
based on "pygettext --help".