[Python-checkins] python/dist/src/Modules _cursesmodule.c, 2.71, 2.72

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Wed Aug 13 17:08:13 EDT 2003


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv2954

Modified Files:
	_cursesmodule.c 
Log Message:
[Patch #739124] Add use_default_colors() to curses module

Index: _cursesmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v
retrieving revision 2.71
retrieving revision 2.72
diff -C2 -d -r2.71 -r2.72
*** _cursesmodule.c	21 Nov 2002 14:17:51 -0000	2.71
--- _cursesmodule.c	13 Aug 2003 23:08:11 -0000	2.72
***************
*** 48,52 ****
  	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
  	wcolor_set winchnstr winchstr winnstr wmouse_trafo wscrl
  
--- 48,52 ----
  	scr_init scr_restore scr_set scrl set_curterm set_term setterm
  	tgetent tgetflag tgetnum tgetstr tgoto timeout tputs
! 	vidattr vidputs waddchnstr waddchstr wchgat
  	wcolor_set winchnstr winchstr winnstr wmouse_trafo wscrl
  
***************
*** 2355,2358 ****
--- 2355,2378 ----
  }
  
+ #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 */
  
***************
*** 2435,2438 ****
--- 2455,2461 ----
    {"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 */
  };





More information about the Python-checkins mailing list