10000 bpo-30176: add missing curses cell attributes constants by zhangyangyu · Pull Request #1302 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
< 8000 turbo-frame id="repo-content-turbo-frame" target="_top" data-turbo-action="advance" class="">

bpo-30176: add missing curses cell attributes constants #1302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 16, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add missing curses cell attributes constants
  • Loading branch information
zhangyangyu committed Apr 26, 2017
commit 56372b760e1dd81e076e2e0297b89fad2c15cad7
28 changes: 27 additions & 1 deletion Doc/library/curses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1271,11 +1271,15 @@ 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_ATTRIBUTES`` | Bit-mask to extract |
10000 Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either add periods at the end of new descriptions or remove them at the end of existing descriptions.

| | attributes |
+------------------+-------------------------------+
| ``A_ALTCHARSET`` | Alternate character set mode. |
+------------------+-------------------------------+
| ``A_BLINK`` | Blink mode. |
Expand All @@ -1286,6 +1290,16 @@ Several constants are available to specify character cell attributes:
+------------------+-------------------------------+
| ``A_DIM`` | Dim mode. |
+------------------+-------------------------------+
| ``A_INVIS`` | Invisible or blank mode |
+------------------+-------------------------------+
| ``A_PROTECT`` | Protected mode |
+------------------+-------------------------------+
| ``A_CHARTEXT`` | Bit-mask to extract a |
| | character |
+------------------+-------------------------------+
| ``A_COLOR`` | Bit-mask to extract |
| | color-pair field information |
+------------------+-------------------------------+
| ``A_NORMAL`` | Normal attribute. |
+------------------+-------------------------------+
| ``A_REVERSE`` | Reverse background and |
Expand All @@ -1295,6 +1309,18 @@ Several constants are available to specify character cell attributes:
+------------------+-------------------------------+
| ``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 |
+------------------+-------------------------------+

.. versionadded:: 3.7
``A_ITALIC`` was added.
Expand Down
8 changes: 5 additions & 3 deletions Modules/_cursesmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3335,9 +3335,6 @@ PyInit__curses(void)
SetDictInt("A_BLINK", A_BLINK);
SetDictInt("A_DIM", A_DIM);
SetDictInt("A_BOLD", A_BOLD);
#ifdef A_ITALIC
SetDictInt("A_ITALIC", A_ITALIC);
#endif
SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
#if !defined(__NetBSD__)
SetDictInt("A_INVIS", A_INVIS);
Expand Down Expand Up @@ -3366,6 +3363,11 @@ PyInit__curses(void)
SetDictInt("A_VERTICAL", A_VERTICAL);
#endif

/* ncurses extension */
#ifdef A_ITALIC
SetDictInt("A_ITALIC", A_ITALIC);
#endif

SetDictInt("COLOR_BLACK", COLOR_BLACK);
SetDictInt("COLOR_RED", COLOR_RED);
SetDictInt("COLOR_GREEN", COLOR_GREEN);
Expand Down
0