From 4873653b8fe1f818e32f287be4dd9df3740011be Mon Sep 17 00:00:00 2001 From: Xiang Zhang Date: Fri, 16 Jun 2017 11:20:07 +0800 Subject: [PATCH 1/2] [3.6] bpo-30176: Add missing curses cell attributes constants (GH-1302). (cherry picked from commit 116dd5eba60a940b35db6aaf4e8c998ac30ad440) --- Doc/library/curses.rst | 54 +++++++++++++++++++++++++++++++++++------- Misc/NEWS | 2 ++ 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index 3442e4e75a3e45..cdbf733d19daa0 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -1271,27 +1271,63 @@ The :mod:`curses` module defines the following data members: A string representing the current version of the module. Also available as :const:`__version__`. -Several constants are available to specify character cell attributes: +Some constants are available to specify character cell attributes. +The exact constants available are system dependent. +------------------+-------------------------------+ | Attribute | Meaning | +==================+===============================+ -| ``A_ALTCHARSET`` | Alternate character set mode. | +| ``A_ALTCHARSET`` | Alternate character set mode | +------------------+-------------------------------+ -| ``A_BLINK`` | Blink mode. | +| ``A_BLINK`` | Blink mode | +------------------+-------------------------------+ -| ``A_BOLD`` | Bold mode. | +| ``A_BOLD`` | Bold mode | +------------------+-------------------------------+ -| ``A_DIM`` | Dim mode. | +| ``A_DIM`` | Dim mode | +------------------+-------------------------------+ -| ``A_NORMAL`` | Normal attribute. | +| ``A_INVIS`` | Invisible or blank mode | ++------------------+-------------------------------+ +| ``A_NORMAL`` | Normal attribute | ++------------------+-------------------------------+ +| ``A_PROTECT`` | Protected mode | +------------------+-------------------------------+ | ``A_REVERSE`` | Reverse background and | -| | foreground colors. | +| | foreground colors | ++------------------+-------------------------------+ +| ``A_STANDOUT`` | Standout mode | ++------------------+-------------------------------+ +| ``A_UNDERLINE`` | Underline mode | ++------------------+-------------------------------+ +| ``A_HORIZONTAL`` | Horizontal highlight | ++------------------+-------------------------------+ +| ``A_LEFT`` | Left highlight | ++------------------+-------------------------------+ +| ``A_LOW`` | Low highlight | ++------------------+-------------------------------+ +| ``A_RIGHT`` | Right highlight | ++------------------+-------------------------------+ +| ``A_TOP`` | Top highlight | ++------------------+-------------------------------+ +| ``A_VERTICAL`` | Vertical highlight | ++------------------+-------------------------------+ +| ``A_CHARTEXT`` | Bit-mask to extract a | +| | character | ++------------------+-------------------------------+ + +Several constants are available to extract corresponding attributes returned +by some methods. + ++------------------+-------------------------------+ +| Bit-mask | Meaning | ++==================+===============================+ +| ``A_ATTRIBUTES`` | Bit-mask to extract | +| | attributes | +------------------+-------------------------------+ -| ``A_STANDOUT`` | Standout mode. | +| ``A_CHARTEXT`` | Bit-mask to extract a | +| | character | +------------------+-------------------------------+ -| ``A_UNDERLINE`` | Underline mode. | +| ``A_COLOR`` | Bit-mask to extract | +| | color-pair field information | +------------------+-------------------------------+ Keys are referred to by integer constants with names starting with ``KEY_``. diff --git a/Misc/NEWS b/Misc/NEWS index 476a50c9d9b22a..8fab1fb2bc4c64 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -266,6 +266,8 @@ Build Documentation ------------- +- bpo-30176: Add missing attribute related constants in curses documentation. + - Issue #30052: the link targets for :func:`bytes` and :func:`bytearray` are now their respective type definitions, rather than the corresponding builtin function entries. Use :ref:`bytes ` From 4603966a9fa846a1c979c4fddf8325541e9b9cb2 Mon Sep 17 00:00:00 2001 From: Mariatta Wijaya Date: Fri, 16 Jun 2017 06:55:15 -0700 Subject: [PATCH 2/2] fix docs build --- Doc/library/curses.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index cdbf733d19daa0..668d2826b0a1b3 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -1283,7 +1283,7 @@ The exact constants available are system dependent. +------------------+-------------------------------+ | ``A_BOLD`` | Bold mode | +------------------+-------------------------------+ -| ``A_DIM`` | Dim mode | +| ``A_DIM`` | Dim mode | +------------------+-------------------------------+ | ``A_INVIS`` | Invisible or blank mode | +------------------+-------------------------------+