diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-07-29 01:49:37 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-07-29 01:49:37 (GMT) |
commit | 6a09315ff098224da138ff708e470ebc1c0ba8ac (patch) | |
tree | e21713f5da3e25fa00aaf284c51273d2acde2884 /Doc/howto | |
parent | 10ea19f69c0bdb2c47aaa29c62dcb1f41825a3dc (diff) | |
parent | 1050d2d0c7730c6c533246bb2404937739a7775c (diff) | |
download | cpython-6a09315ff098224da138ff708e470ebc1c0ba8ac.zip cpython-6a09315ff098224da138ff708e470ebc1c0ba8ac.tar.gz cpython-6a09315ff098224da138ff708e470ebc1c0ba8ac.tar.bz2 |
Issue #26462: Merge code block fixes from 3.5
Diffstat (limited to 'Doc/howto')
-rw-r--r-- | Doc/howto/clinic.rst | 4 | ||||
-rw-r--r-- | Doc/howto/logging-cookbook.rst | 20 | ||||
-rw-r--r-- | Doc/howto/logging.rst | 17 | ||||
-rw-r--r-- | Doc/howto/regex.rst | 4 | ||||
-rw-r--r-- | Doc/howto/unicode.rst | 4 |
5 files changed, 36 insertions, 13 deletions
diff --git a/Doc/howto/clinic.rst b/Doc/howto/clinic.rst index 82eae01..5a69ca8 100644 --- a/Doc/howto/clinic.rst +++ b/Doc/howto/clinic.rst @@ -152,7 +152,9 @@ Let's dive in! For my example I'm using ``_pickle.Pickler.dump()``. 2. If the call to the ``PyArg_Parse`` function uses any of the - following format units:: + following format units: + + .. code-block:: none O& O! diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst index 99b4cdc..de0d304 100644 --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -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. diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst index 51e8430..82d1308 100644 --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -106,7 +106,9 @@ A very simple example is:: logging.warning('Watch out!') # will print a message to the console logging.info('I told you so') # will not print anything -If you type these lines into a script and run it, you'll see:: +If you type these lines into a script and run it, you'll see: + +.. code-block:: none WARNING:root:Watch out! @@ -230,7 +232,9 @@ append the variable data as arguments. For example:: import logging logging.warning('%s before you %s', 'Look', 'leap!') -will display:: +will display: + +.. code-block:: none WARNING:root:Look before you leap! @@ -594,7 +598,9 @@ logger, a console handler, and a simple formatter using Python code:: logger.error('error message') logger.critical('critical message') -Running this module from the command line produces the following output:: +Running this module from the command line produces the following output: + +.. code-block:: shell-session $ python simple_logging_module.py 2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message @@ -653,7 +659,9 @@ Here is the logging.conf file:: format=%(asctime)s - %(name)s - %(levelname)s - %(message)s datefmt= -The output is nearly identical to that of the non-config-file-based example:: +The output is nearly identical to that of the non-config-file-based example: + +.. code-block:: shell-session $ python simple_logging_config.py 2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message @@ -1073,4 +1081,3 @@ take up any memory. Useful handlers included with the logging module. :ref:`A logging cookbook <logging-cookbook>` - diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst index 371ef59..d9b7c90 100644 --- a/Doc/howto/regex.rst +++ b/Doc/howto/regex.rst @@ -74,7 +74,9 @@ of the RE by repeating them or changing their meaning. Much of this document is devoted to discussing various metacharacters and what they do. Here's a complete list of the metacharacters; their meanings will be discussed -in the rest of this HOWTO. :: +in the rest of this HOWTO. + +.. code-block:: none . ^ $ * + ? { } [ ] \ | ( ) diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst index 50a09ba..fbeb11a 100644 --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -613,7 +613,9 @@ program:: print(os.listdir(b'.')) print(os.listdir('.')) -will produce the following output:: +will produce the following output: + +.. code-block:: shell-session amk:~$ python t.py [b'filename\xe4\x94\x80abc', ...] |