Issue #26462: Doc: reduce literal_block warnings, fix syntax highlighting.

Patch by Julien Palard.
This commit is contained in:
Martin Panter 2016-07-26 11:18:21 +02:00
parent 87ec85f420
commit 1050d2d0c7
47 changed files with 329 additions and 128 deletions

View file

@ -377,7 +377,9 @@ An example of using these two classes follows (imports omitted)::
root.warning('Look out!')
listener.stop()
which, when run, will produce::
which, when run, will produce:
.. code-block:: none
MainThread: Look out!
@ -1860,7 +1862,9 @@ script, ``chowntest.py``::
logger = logging.getLogger('mylogger')
logger.debug('A debug message')
To run this, you will probably need to run as ``root``::
To run this, you will probably need to run as ``root``:
.. code-block:: shell-session
$ sudo python3.3 chowntest.py
$ cat chowntest.log
@ -2485,7 +2489,9 @@ via ``stderr`` and once via ``stdout``). After the ``with`` statement's
completion, the status is as it was before so message #6 appears (like message
#1) whereas message #7 doesn't (just like message #2).
If we run the resulting script, the result is as follows::
If we run the resulting script, the result is as follows:
.. code-block:: shell-session
$ python logctx.py
1. This should appear just once on stderr.
@ -2495,12 +2501,16 @@ If we run the resulting script, the result is as follows::
6. This should appear just once on stderr.
If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the following,
which is the only message written to ``stdout``::
which is the only message written to ``stdout``:
.. code-block:: shell-session
$ python logctx.py 2>/dev/null
5. This should appear twice - once on stderr and once on stdout.
Once again, but piping ``stdout`` to ``/dev/null``, we get::
Once again, but piping ``stdout`` to ``/dev/null``, we get:
.. code-block:: shell-session
$ python logctx.py >/dev/null
1. This should appear just once on stderr.