Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3efdf06

Browse files
committed
Merged revisions 86521,86632,86823-86824,87294,87296,87300,87302 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r86521 | eric.araujo | 2010-11-18 17:38:46 +0100 (jeu., 18 nov. 2010) | 17 lines Fix usage of :option: in the docs (#9312). :option: is used to create a link to an option of python, not to mark up any instance of any arbitrary command-line option. These were changed to ````. For modules which do have a command-line interface, lists of options have been properly marked up with the program/cmdoption directives combo. Options defined in such blocks can be linked to with :option: later in the same file, they won’t link to an option of python. Finally, the markup of command-line fragments in optparse.rst has been cleaned to use ``x`` instead of ``"x"``, keeping that latter form for actual Python strings. Patch by Eli Bendersky and Éric Araujo. ........ r86632 | eric.araujo | 2010-11-21 04:09:17 +0100 (dim., 21 nov. 2010) | 2 lines Style edits in followup to r86521 (#9312) ........ r86823 | eric.araujo | 2010-11-27 00:31:07 +0100 (sam., 27 nov. 2010) | 2 lines Use link-generating markup (see #9312) ........ r86824 | eric.araujo | 2010-11-27 00:46:18 +0100 (sam., 27 nov. 2010) | 2 lines Rewrap long lines + minor edits ........ r87294 | eric.araujo | 2010-12-16 01:07:01 +0100 (jeu., 16 déc. 2010) | 2 lines No need to generate a link for something that’s just above. ........ r87296 | eric.araujo | 2010-12-16 01:23:30 +0100 (jeu., 16 déc. 2010) | 2 lines Advertise “python -m” instead of direct filename. ........ r87300 | eric.araujo | 2010-12-16 02:40:26 +0100 (jeu., 16 déc. 2010) | 2 lines Advertise “python -m test” over test.regrtest (r87296 followup) ........ r87302 | eric.araujo | 2010-12-16 03:10:11 +0100 (jeu., 16 déc. 2010) | 2 lines Add versionadded directive missing from r78983. ........
1 parent b7ae209 commit 3efdf06

13 files changed

Lines changed: 197 additions & 137 deletions

Doc/library/codecs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ Encodings and Unicode
788788

789789
Strings are stored internally as sequences of codepoints (to be precise
790790
as :ctype:`Py_UNICODE` arrays). Depending on the way Python is compiled (either
791-
via :option:`--without-wide-unicode` or :option:`--with-wide-unicode`, with the
791+
via ``--without-wide-unicode`` or ``--with-wide-unicode``, with the
792792
former being the default) :ctype:`Py_UNICODE` is either a 16-bit or 32-bit data
793793
type. Once a string object is used outside of CPU and memory, CPU endianness
794794
and how these arrays are stored as bytes become an issue. Transforming a

Doc/library/compileall.rst

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,44 @@ libraries. These functions compile Python source files in a directory tree,
1010
allowing users without permission to write to the libraries to take advantage of
1111
cached byte-code files.
1212

13-
This module may also be used as a script (using the :option:`-m` Python flag) to
14-
compile Python sources. Directories to recursively traverse (passing
15-
:option:`-l` stops the recursive behavior) for sources are listed on the command
16-
line. If no arguments are given, the invocation is equivalent to ``-l
17-
sys.path``. Printing lists of the files compiled can be disabled with the
18-
:option:`-q` flag. In addition, the :option:`-x` option takes a regular
19-
expression argument. All files that match the expression will be skipped.
2013

14+
Command-line use
15+
----------------
16+
17+
This module can work as a script (using :program:`python -m compileall`) to
18+
compile Python sources.
19+
20+
.. program:: compileall
21+
22+
.. cmdoption:: [directory|file]...
23+
24+
Positional arguments are files to compile or directories that contain
25+
source files, traversed recursively. If no argument is given, behave as if
26+
the command line was ``-l <directories from sys.path>``.
27+
28+
.. cmdoption:: -l
29+
30+
Do not recurse.
31+
32+
.. cmdoption:: -f
33+
34+
Force rebuild even if timestamps are up-to-date.
35+
36+
.. cmdoption:: -q
37+
38+
Do not print the list of files compiled.
39+
40+
.. cmdoption:: -d destdir
41+
42+
Purported directory name for error messages.
43+
44+
.. cmdoption:: -x regex
45+
46+
Skip files with a full path that matches given regular expression.
47+
48+
49+
Public functions
50+
----------------
2151

2252
.. function:: compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None, quiet=False)
2353

@@ -34,7 +64,6 @@ expression argument. All files that match the expression will be skipped.
3464
If *quiet* is true, nothing is printed to the standard output in normal
3565
operation.
3666

37-
3867
.. function:: compile_path(skip_curdir=True, maxlevels=0, force=False)
3968

4069
Byte-compile all the :file:`.py` files found along ``sys.path``. If
@@ -58,4 +87,3 @@ subdirectory and all its subdirectories::
5887

5988
Module :mod:`py_compile`
6089
Byte-compile a single source file.
61-

Doc/library/doctest.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ works its magic::
8888
$
8989

9090
There's no output! That's normal, and it means all the examples worked. Pass
91-
:option:`-v` to the script, and :mod:`doctest` prints a detailed log of what
91+
``-v`` to the script, and :mod:`doctest` prints a detailed log of what
9292
it's trying, and prints a summary at the end::
9393

9494
$ python example.py -v
@@ -151,7 +151,7 @@ example(s) and the cause(s) of the failure(s) are printed to stdout, and the
151151
final line of output is ``***Test Failed*** N failures.``, where *N* is the
152152
number of examples that failed.
153153

154-
Run it with the :option:`-v` switch instead::
154+
Run it with the ``-v`` switch instead::
155155

156156
python M.py -v
157157

@@ -160,7 +160,7 @@ with assorted summaries at the end.
160160

161161
You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, or
162162
prohibit it by passing ``verbose=False``. In either of those cases,
163-
``sys.argv`` is not examined by :func:`testmod` (so passing :option:`-v` or not
163+
``sys.argv`` is not examined by :func:`testmod` (so passing ``-v`` or not
164164
has no effect).
165165

166166
There is also a command line shortcut for running :func:`testmod`. You can
@@ -229,7 +229,7 @@ See section :ref:`doctest-basic-api` for a description of the optional arguments
229229
that can be used to tell it to look for files in other locations.
230230

231231
Like :func:`testmod`, :func:`testfile`'s verbosity can be set with the
232-
:option:`-v` command-line switch or with the optional keyword argument
232+
``-v`` command-line switch or with the optional keyword argument
233233
*verbose*.
234234

235235
There is also a command line shortcut for running :func:`testfile`. You can
@@ -1361,7 +1361,7 @@ DocTestRunner objects
13611361
verbosity. If *verbose* is ``True``, then information is printed about each
13621362
example, as it is run. If *verbose* is ``False``, then only failures are
13631363
printed. If *verbose* is unspecified, or ``None``, then verbose output is used
1364-
iff the command-line switch :option:`-v` is used.
1364+
iff the command-line switch ``-v`` is used.
13651365

13661366
The optional keyword argument *optionflags* can be used to control how the test
13671367
runner compares expected output to actual output, and how it displays failures.

Doc/library/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The following exceptions are the exceptions that are usually raised.
120120

121121
Raised when a floating point operation fails. This exception is always defined,
122122
but can only be raised when Python is configured with the
123-
:option:`--with-fpectl` option, or the :const:`WANT_SIGFPE_HANDLER` symbol is
123+
``--with-fpectl`` option, or the :const:`WANT_SIGFPE_HANDLER` symbol is
124124
defined in the :file:`pyconfig.h` file.
125125

126126

Doc/library/getopt.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ exception:
4141
empty string. Long options on the command line can be recognized so long as
4242
they provide a prefix of the option name that matches exactly one of the
4343
accepted options. For example, if *longopts* is ``['foo', 'frob']``, the
44-
option :option:`--fo` will match as :option:`--foo`, but :option:`--f` will
44+
option ``--fo`` will match as ``--foo``, but ``--f`` will
4545
not match uniquely, so :exc:`GetoptError` will be raised.
4646

4747
The return value consists of two elements: the first is a list of ``(option,
@@ -62,7 +62,7 @@ exception:
6262
intermixed. The :func:`getopt` function stops processing options as soon as a
6363
non-option argument is encountered.
6464

65-
If the first character of the option string is '+', or if the environment
65+
If the first character of the option string is ``'+'``, or if the environment
6666
variable :envvar:`POSIXLY_CORRECT` is set, then option processing stops as
6767
soon as a non-option argument is encountered.
6868

Doc/library/idle.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,13 @@ Command line usage
286286

287287
If there are arguments:
288288

289-
#. If :option:`-e` is used, arguments are files opened for editing and
289+
#. If ``-e`` is used, arguments are files opened for editing and
290290
``sys.argv`` reflects the arguments passed to IDLE itself.
291291

292-
#. Otherwise, if :option:`-c` is used, all arguments are placed in
292+
#. Otherwise, if ``-c`` is used, all arguments are placed in
293293
``sys.argv[1:...]``, with ``sys.argv[0]`` set to ``'-c'``.
294294

295-
#. Otherwise, if neither :option:`-e` nor :option:`-c` is used, the first
295+
#. Otherwise, if neither ``-e`` nor ``-c`` is used, the first
296296
argument is a script which is executed with the remaining arguments in
297297
``sys.argv[1:...]`` and ``sys.argv[0]`` set to the script name. If the script
298298
name is '-', no script is executed but an interactive Python session is started;

0 commit comments

Comments
 (0)