[Patches] [Patch #102813] _cursesmodule: Add panel support

noreply@sourceforge.net noreply@sourceforge.net
Fri, 22 Dec 2000 13:59:35 -0800


Patch #102813 has been updated. 

Project: python
Category: Modules
Status: Closed
Submitted by: akuchling
Assigned to : akuchling
Summary: _cursesmodule: Add panel support

Follow-Ups:

Date: 2000-Dec-22 13:59
By: akuchling

Comment:
Checked in.
-------------------------------------------------------

Date: 2000-Dec-22 07:07
By: fdrake

Comment:
The indentation in the new module is different from the _curses implementation and from the "standard" Python conventions; can we bring it into line with *something* else in the distribution?  Any of:

  * Guido-style:  8-column hard-tab indents.
  * New style:  4-column space-only indents.
  * _curses style: 2 column indents.

I'd prefer "New style", myself.

Otherwise it looks good from a very quick look.  Documentation is required.  Put that in a new file, Doc/lib/libcursespanel.tex.
-------------------------------------------------------

Date: 2000-Dec-22 06:24
By: akuchling

Comment:
Reassigning to Fred for a quick proofreading.  Feel free to reassign
it to another of the Pythoneers if you like.
-------------------------------------------------------

Date: 2000-Dec-18 19:02
By: akuchling

Comment:
Greatly revised version of this patch.  

Using a CObject, _cursesmodule.c now exports an API 
for other C extensions, and the panel extensions have been
moved into a _curses_panel.c file.  

Not included in this patch: Lib/curses/panel.py, which just imports
everything public from _curses_panel,  documentation changes,
and the modified Setup.in file.
-------------------------------------------------------

Date: 2000-Dec-15 05:20
By: akuchling

Comment:
Updated version of the patch from Thomas, that fixes
most of my previous comments.
-------------------------------------------------------

Date: 2000-Dec-12 20:03
By: akuchling

Comment:
Patch from Thomas Gellekum to add panel support.

My comments:

* Module-level panel_above and panel_below: how about naming them 
  top_panel() and bottom_panel()?

* In PyCurses_Panel_Below(), the text of an exception refers to panel_above
  (cut-and-paste error)

* Maybe the panel functions should be in a separate file that gets #included;
  _cursesmodule.c is 2502 lines long, which is really cumbersome.  
  The window functions should also be split out; I'll bring this up on
  python-dev.  

* set_panel_userptr() and panel_userptr(): why require that they be strings?
  They could simply be arbitrary Python objects that get INCREF'ed.  
  (And I think saving a pointer output of PyArg_Parse() is incorrect;
  if the string is then deleted, this will become a dangling pointer).

* PyCursesPanel_Replace_Panel(): you can parse arguments and 
  require them to be of a certain class with  PyArg_ParseTuple(args, "O!",
  &PyWhatever_Type, &arg, ...)

* PyCursesPanel_Replace_Panel(): Can replace_panel() fail?  If so, then 
  the old and new window objects should only be DECREF/INCREF'ed if 
  no error occurred.  (There's also a panel_above reference in an
  exception here.)

* panel_above/below(): what do they return when called on the top or
bottom panel?  (NULL would be a natural return value, so I'm wondering
if NULL is really an error.)

* I don't think Py_FatalError() should be used when a panel isn't on
the linked list.  (Perhaps some C code is creating panels.)  Instead
this should simply raise a regular exception, perhaps RuntimeError.

These are my comments for now, but I'll keep looking at the code./


-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102813&group_id=5470