@@ -0,0 +1,1241 @@
+#!/usr/bin/env python%0A#%0A# $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $%0A#%0A# Interactive test suite for the curses module.%0A# This script displays various things and the user should verify whether%0A# they display correctly.%0A#%0A%0Aimport curses%0Afrom curses import textpad%0A%0Adef test_textpad(stdscr, insert_mode=False):%0A    ncols, nlines = 8, 3%0A    uly, ulx = 3, 2%0A    if insert_mode:%0A        mode = 'insert mode'%0A    else:%0A        mode = 'overwrite mode'%0A%0A    stdscr.addstr(uly-3, ulx, %22Use Ctrl-G to end editing (%25s).%22 %25 mode)%0A    stdscr.addstr(uly-2, ulx, %22Be sure to try typing in the lower-right corner.%22)%0A    win = curses.newwin(nlines, ncols, uly, ulx)%0A    textpad.rectangle(stdscr, uly-1, ulx-1, uly + nlines, ulx + ncols)%0A    stdscr.refresh()%0A%0A    box = textpad.Textbox(win, insert_mode)%0A    contents = box.edit()%0A    stdscr.addstr(uly+ncols+2, 0, %22Text entered in the box%5Cn%22)%0A    stdscr.addstr(repr(contents))%0A    stdscr.addstr('%5Cn')%0A    stdscr.addstr('Press any key')%0A    stdscr.getch()%0A%0A    for i in range(3):%0A        stdscr.move(uly+ncols+2 + i, 0)%0A        stdscr.clrtoeol()%0A%0Adef main(stdscr):%0A    stdscr.clear()%0A    test_textpad(stdscr, False)%0A    test_textpad(stdscr, True)%0A%0A%0Aif __name__ == '__main__':%0A    curses.wrapper(main)%0A

Add an interactive test script for exercising curses