Copyright (C) 2000-2012 |
GNU Info (python2.1-lib.info)curses.wrapperTerminal handler for curses programs ==================================== This manual section was written by Eric Raymond <esr@thyrsus.com>. This module was written by Eric Raymond <esr@thyrsus.com>. Terminal configuration wrapper for curses programs. _Added in Python version 1.6_ This module supplies one function, `wrapper()', which runs another function which should be the rest of your curses-using application. If the application raises an exception, `wrapper()' will restore the terminal to a sane state before passing it further up the stack and generating a traceback. `wrapper(func, ...)' Wrapper function that initializes curses and calls another function, FUNC, restoring normal keyboard/screen behavior on error. The callable object FUNC is then passed the main window 'stdscr' as its first argument, followed by any other arguments passed to `wrapper()'. Before calling the hook function, `wrapper()' turns on cbreak mode, turns off echo, enables the terminal keypad, and initializes colors if the terminal has color support. On exit (whether normally or by exception) it restores cooked mode, turns on echo, and disables the terminal keypad. automatically generated by info2www version 1.2.2.9 |