Skip to content
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

gh-81163: Add support for extended color functions in ncurses 6.1 #17536

Merged
merged 30 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
360bb19
bpo-36982, bpo-36630: replumb these curses module functions to suppor…
websurfer5 May 21, 2019
2be663b
bpo-36982, bpo-36630: refactor the curses color implementation functi…
websurfer5 May 22, 2019
6893bfe
bpo-36982, bpo-36630: _NCURSES_EXTENDED_COLOR_FUNCS is always defined…
websurfer5 May 23, 2019
fb6d81e
bpo-36982: add new function: curses.has_extended_color_support() to i…
websurfer5 May 24, 2019
3d48299
bpo-36982, bpo-36630: add test for curses.has_extended_color_support()
websurfer5 May 24, 2019
7337433
bpo-36982: reorganize new code to keep clinic happy
websurfer5 May 24, 2019
de55056
📜🤖 Added by blurb_it.
blurb-it[bot] May 25, 2019
a3827ec
bpo-36982: refactor color-pair functions to use clinic
websurfer5 May 29, 2019
7de2eb0
bpo-36982: Add back has_extended_color_support() method lost during r…
hpjansson Dec 9, 2019
b07f1bd
bpo-36982: Add back init_color() to clinic input
hpjansson Dec 9, 2019
ec1aecd
bpo-36982: Move the whatsnew entry forward to 3.9.
hpjansson May 5, 2020
9593685
bpo-36982: Improve error messages and fix code formatting
hpjansson May 5, 2020
e8f678b
bpo-36982: Move _curses_pair_content__doc__ back where it belongs
hpjansson May 5, 2020
2f8c724
bpo-36982: Use a plain integer for color pair argument
hpjansson May 5, 2020
fd4c215
bpo-36982: Revert rgb values to short; they are in the 0-1000 range
hpjansson May 5, 2020
cd9b643
bpo-36982: Improve error message specificity and formatting
hpjansson May 5, 2020
8c89c23
bpo-36982: Let Clinic remove redundant calls to PyFloat_Check()
hpjansson Jul 1, 2020
023d41c
bpo-36982: Move whatsnew entry forward from 3.9 to 3.10
hpjansson Jul 1, 2020
b777e93
bpo-36982: Use converters for color numbers and color pairs
hpjansson Jul 3, 2020
1242214
bpo-36982: Use converters for color components
hpjansson Jul 3, 2020
eb61ff5
bpo-36982: Throw ValueError instead of OverflowError if arg out of range
hpjansson Jul 3, 2020
3fe7b1a
bpo-36982: Improve error messages and tighten range checking
hpjansson Jul 3, 2020
333f54d
bpo-36982: Remove unused defines
hpjansson Jul 3, 2020
1749b1e
bpo-36982: Update accreditation
hpjansson Jul 3, 2020
f5a9873
bpo-36982: Properly check for overflow in converters
hpjansson Jul 16, 2020
9bad726
bpo-36982: Shortcut error checking in converters
hpjansson Jul 16, 2020
29efcf3
bpo-36982: Revert unrelated changes
hpjansson Jul 16, 2020
81ad399
bpo-36982: Define extended color macros in single block for clarity
hpjansson Jul 16, 2020
9ec614a
bpo-36982: Add ValueError tests for color and pair converters
hpjansson Jul 16, 2020
70fdaf3
bpo-36982: Add back documentation for has_extended_color_support()
hpjansson Jul 29, 2020
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
10 changes: 10 additions & 0 deletions Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ New Modules
Improved Modules
================

curses
------

The extended color functions added in ncurses 6.1 will be used transparently
by :func:`curses.color_content`, :func:`curses.init_color`,
:func:`curses.init_pair`, and :func:`curses.pair_content`. A new function,
:func:`curses.has_extended_color_support`, indicates whether extended color
support is provided by the underlying ncurses library.
(Contributed by Jeffrey Kintscher and Hans Petter Jansson in :issue:`36982`.)

glob
----

Expand Down
3 changes: 2 additions & 1 deletion Lib/test/test_curses.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def test_module_funcs(self):
curses.nocbreak, curses.noecho, curses.nonl,
curses.noqiflush, curses.noraw,
curses.reset_prog_mode, curses.termattrs,
curses.termname, curses.erasechar]:
curses.termname, curses.erasechar,
curses.has_extended_color_support]:
with self.subTest(func=func.__qualname__):
func()
if hasattr(curses, 'filter'):
Expand Down
2 changes: 2 additions & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ Geert Jansen
Jack Jansen
Hans-Peter Jansen
Bill Janssen
Hans Petter Jansson
Jon Janzen
Thomas Jarosch
Juhana Jauhiainen
Expand Down Expand Up @@ -882,6 +883,7 @@ Sam Kimbrel
Tomohiko Kinebuchi
James King
W. Trevor King
Jeffrey Kintscher
Paul Kippes
Steve Kirsch
Sebastian Kirsche
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use ncurses extended color functions when available to support terminals with 256 colors, and add the new function :func:`curses.has_extended_color_support` to indicate whether extended color support is provided by the underlying ncurses library.
Loading