diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-06-19 14:38:02 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-06-19 14:38:02 (GMT) |
commit | 12f2bffce1be0e36e2cf11a8be80de7fcb76dd54 (patch) | |
tree | 1f37a3639480738daf90d359dbc239ac664860f3 /Doc | |
parent | defe6f61fe8595d0d2cc194c120ef0b3dc3a4286 (diff) | |
parent | 2510d9e8d9d3244c8d35efdd01bca265755655de (diff) | |
download | cpython-12f2bffce1be0e36e2cf11a8be80de7fcb76dd54.zip cpython-12f2bffce1be0e36e2cf11a8be80de7fcb76dd54.tar.gz cpython-12f2bffce1be0e36e2cf11a8be80de7fcb76dd54.tar.bz2 |
merge heads
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/curses.rst | 46 | ||||
-rw-r--r-- | Doc/library/faulthandler.rst | 2 |
2 files changed, 14 insertions, 34 deletions
diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index 1ca22c8..73b957e 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -41,10 +41,6 @@ Linux and the BSD variants of Unix. Module :mod:`curses.textpad` Editable text widget for curses supporting :program:`Emacs`\ -like bindings. - Module :mod:`curses.wrapper` - Convenience function to ensure proper terminal setup and resetting on - application entry and exit. - :ref:`curses-howto` Tutorial material on using curses with Python, by Andrew Kuchling and Eric Raymond. @@ -592,6 +588,19 @@ The module :mod:`curses` defines the following functions: foreground color on the default background. +.. function:: wrapper(func, ...) + + Initialize curses and call another callable object, *func*, which should be the + rest of your curses-using application. If the application raises an exception, + this function will restore the terminal to a sane state before re-raising the + exception and generating a traceback. The callable object *func* is then passed + the main window 'stdscr' as its first argument, followed by any other arguments + passed to :func:`wrapper`. Before calling *func*, :func:`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. + + .. _curses-window-objects: Window Objects @@ -1659,32 +1668,3 @@ You can instantiate a :class:`Textbox` object as follows: cursor motion that would land the cursor on a trailing blank goes to the end of that line instead, and trailing blanks are stripped when the window contents are gathered. - - -:mod:`curses.wrapper` --- Terminal handler for curses programs -============================================================== - -.. module:: curses.wrapper - :synopsis: Terminal configuration wrapper for curses programs. -.. moduleauthor:: Eric Raymond <esr@thyrsus.com> -.. sectionauthor:: Eric Raymond <esr@thyrsus.com> - - -This module supplies one function, :func:`wrapper`, which runs another function -which should be the rest of your curses-using application. If the application -raises an exception, :func:`wrapper` will restore the terminal to a sane state -before re-raising the exception and generating a traceback. - - -.. function:: 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 :func:`wrapper`. - -Before calling the hook function, :func:`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. - diff --git a/Doc/library/faulthandler.rst b/Doc/library/faulthandler.rst index b0f8cb4..3e75c60 100644 --- a/Doc/library/faulthandler.rst +++ b/Doc/library/faulthandler.rst @@ -24,7 +24,7 @@ tracebacks: * Only ASCII is supported. The ``backslashreplace`` error handler is used on encoding. * Each string is limited to 100 characters. -* Only the the filename, the function name and the line number are +* Only the filename, the function name and the line number are displayed. (no source code) * It is limited to 100 frames and 100 threads. |