summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-08-13 23:11:04 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-08-13 23:11:04 (GMT)
commit69f31eb80c86f74cf35ae313870f87b6611293fa (patch)
tree16babeca0ce1b9f6d59c37ac730d0dd17b5defb8 /Modules
parenta54b92b2ebcbaaa4b7f77ff411a73a820522a67b (diff)
downloadcpython-69f31eb80c86f74cf35ae313870f87b6611293fa.zip
cpython-69f31eb80c86f74cf35ae313870f87b6611293fa.tar.gz
cpython-69f31eb80c86f74cf35ae313870f87b6611293fa.tar.bz2
[Patch #739124] Add use_default_colors() to curses module
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_cursesmodule.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 4424dae..51f4c38 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -47,7 +47,7 @@ unsupported functions:
resizeterm restartterm ripoffline scr_dump
scr_init scr_restore scr_set scrl set_curterm set_term setterm
tgetent tgetflag tgetnum tgetstr tgoto timeout tputs
- use_default_colors vidattr vidputs waddchnstr waddchstr wchgat
+ vidattr vidputs waddchnstr waddchstr wchgat
wcolor_set winchnstr winchstr winnstr wmouse_trafo wscrl
Low-priority:
@@ -2354,6 +2354,26 @@ PyCurses_Use_Env(PyObject *self, PyObject *args)
return Py_None;
}
+#ifndef STRICT_SYSV_CURSES
+static PyObject *
+PyCurses_Use_Default_Colors(PyObject *self)
+{
+ int code;
+
+ PyCursesInitialised
+ PyCursesInitialisedColor
+
+ code = use_default_colors();
+ if (code != ERR) {
+ Py_INCREF(Py_None);
+ return Py_None;
+ } else {
+ PyErr_SetString(PyCursesError, "use_default_colors() returned ERR");
+ return NULL;
+ }
+}
+#endif /* STRICT_SYSV_CURSES */
+
/* List of functions defined in the module */
static PyMethodDef PyCurses_methods[] = {
@@ -2434,6 +2454,9 @@ static PyMethodDef PyCurses_methods[] = {
{"unctrl", (PyCFunction)PyCurses_UnCtrl, METH_VARARGS},
{"ungetch", (PyCFunction)PyCurses_UngetCh, METH_VARARGS},
{"use_env", (PyCFunction)PyCurses_Use_Env, METH_VARARGS},
+#ifndef STRICT_SYSV_CURSES
+ {"use_default_colors", (PyCFunction)PyCurses_Use_Default_Colors, METH_NOARGS},
+#endif
{NULL, NULL} /* sentinel */
};