diff options
Diffstat (limited to 'docs')
73 files changed, 1471 insertions, 85 deletions
diff --git a/docs/Makefile b/docs/Makefile index 9c9ef20..7ec3bdb 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,5 +1,5 @@ -PYTHON_SOURCE=$(shell echo tutorial/*.py.xdotool) +PYTHON_SOURCE=$(shell echo */*.py.xdotool) TARGETS=${PYTHON_SOURCE:.py.xdotool=1.png} TOOLS=tools/compile_pngs.sh tools/screenshots.sh diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 100644 index 0000000..0bfb7c5 --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1,1095 @@ + +Changelog +--------- + + +Urwid 1.2.1 +=========== + +2014-04-04 + + * Fix false failures of event loop tests + + * Remove extra newline generated on exit of raw_display + + * Documentation fixes (by Paul Ivanov) + + +Urwid 1.2.0 +=========== + +2014-02-09 + + * Add support for PyPy, drop support for Python 2.4, 2.5 + + * Signals now support using weakly referenced arguments to help + avoid leaking objects when a signal consumer is no longer + referenced (by Matthijs Kooijman) + + * Add TornadoEventLoop class (by Alexander Glyzov) + + * Update GlibEventLoop to use python-gi for Python3 compatibility + (by Israel Garcia) + + * Automate testing with Python 2.6, 2.7, 3.2, 3.3 and PyPy using + travis-ci + + * New container method get_focus_widgets() (by Matthijs Kooijman) + + * Add support for double and triple click mouse events + (by Igor Kotrasiński) + + * Allow disabling and re-enabling of mouse tracking + (by Jim Garrison) + + * Create section in docs for example program screenshots generated + as images like the tutorial examples + + * Add suggested basic color combination images to manual + + * Fall back to 80x24 if screen size detection fails + + * Fix screen.stop(), screen.start() disabling mouse events + + * Fix to make GridFlow v_sep argument behave as documented + + * Fix for registering high palette entries in the form "hX" where + X > 15 so that basic colors are applied in 88-color mode + + * Fix for raw_display clear-right escape not working with + standout attribute on some terminals + + * Fix for Terminal widget select loop: retry when interrupted + + +Urwid 1.1.2 +=========== + +2013-12-30 + + * Move to urwid.org and use sphinx docs for generating whole site, + move changelog to docs/changelog.rst + + * Fix encoding exceptions when unicode used on non-UTF-8 terminal + + * Fix for suspend and resume applications with ^Z + + * Fix for tmux and screen missing colors on right bug + + * Fix Pile zero-weighted items and mouse_event when empty + + * Fix Terminal select() not retrying when interrupted by signal + + * Fix for Padding.align and width change not invalidating + + +Urwid 1.1.1 +=========== + +2012-11-15 + + * Fix for Pile not changing focus on mouse events + + * Fix for Overlay.get_cursor_coords() + + +Urwid 1.1.0 +=========== + +2012-10-23 + + * New common container API: focus, focus_position, contents, + options(), get_focus_path(), set_focus_path(), __getitem__, + __iter__(), __reversed__() implemented across all included + container widgets + + A full description doesn't fit here, see the Container Widgets + section in the manual for details + + * New Sphinx-based documentation now included in source: + Tutorial rewritten, manual revised and new reference based + on updated docstrings (by Marco Giusti, Patrick Totzke) + + * New list walker SimpleFocusListWalker like SimpleListWalker but + updates focus position as items are inserted or removed + + * New decoration widget WidgetDisable to disable interaction + with the widgets it wraps + + * SelectableIcon selectable text widget used by button widgets is + now documented (available since 0.9.9) + + * Columns widget now tries to keep column in focus visible, hiding + columns on the left when necessary + + * Padding widget now defaults to ('relative', 100) instead of + 'pack' so that left and right parameters are more useful and more + child widgets are supported + + * New list walker "API Version 2" that is simpler for many list + walker uses; "API Version 1" will still continue to be supported + + * List walkers may now allow iteration from the absolute top or + bottom of the list if they provide a positions() method + + * raw_display now erases to the end of the line with EL escape + sequence to improve copy+paste behavior for some terminals + + * Filler now has top and bottom parameters like Padding's left and + right parameters and accepts 'pack' instead of None as a height + value for widgets that calculate their own number of rows + + * Pile and Columns now accepts 'pack' instead of 'flow' for widgets + that calculate their own number of rows or columns + + * Pile and Columns now accept 'given' instead of 'fixed' for + cases where the number of rows or columns are specified by the + container options + + * Pile and Columns widgets now accept any iterable to their + __init__() methods + + * Widget now has a default focus_position property that raises + an IndexError when read to be consistent with new common container + API + + * GridFlow now supports multiple cell widths within the same widget + + * BoxWidget, FlowWidget and FixedWidget are deprecated, instead + use the sizing() function or _sizing attribute to specify the + supported sizing modes for your custom widgets + + * Some new shift+arrow and numpad input sequences from RXVT and + xterm are now recognized + + * Fix for alarms when used with a screen event loop (e.g. + curses_display) + + * Fix for raw_display when terminal width is 1 column + + * Fixes for a Columns.get_cursor_coords() regression and a + SelectableIcon.get_cursor_coords() bug + + * Fixes for incorrect handling of box columns in a number of + Columns methods when that column is selectable + + * Fix for Terminal widget input handling with Python 3 + + +Urwid 1.0.3 +=========== + +2012-11-15 + + * Fix for alarms when used with a screen event loop (e.g. + curses_display) + + * Fix for Overlay.get_cursor_coords() + + +Urwid 1.0.2 +=========== + +2012-07-13 + + * Fix for bug when entering Unicode text into Edit widget with + bytes caption + + * Fix a regression when not running in UTF-8 mode + + * Fix for a MainLoop.remove_watch_pipe() bug + + * Fix for a bug when packing empty Edit widgets + + * Fix for a ListBox "contents too long" error with very large + Edit widgets + + * Prevent ListBoxes from selecting 0-height selectable widgets + when moving up or down + + * Fix a number of bugs caused by 0-height widgets in a ListBox + + +Urwid 1.0.1 +=========== + +2011-11-28 + + * Fix for Terminal widget in BSD/OSX + + * Fix for a Filler mouse_event() position bug + + * Fix support for mouse positions up to x=255, y=255 + + * Fixes for a number of string encoding issues under Python 3 + + * Fix for a LineBox border __init__() parameters + + * Fix input input of UTF-8 in tour.py example by converting captions + to unicode + + * Fix tutorial examples' use of TextCanvas and switch to using + unicode literals + + * Prevent raw_display from calling tcseattr() or tcgetattr() on + non-ttys + + * Disable curses_display external event loop support: screen resizing + and gpm events are not properly supported + + * Mark PollingListWalker as deprecated + + +Urwid 1.0.0 +=========== + +2011-09-22 + + * New support for Python 3.2 from the same 2.x code base, + requires distribute instead of setuptools (by Kirk McDonald, + Wendell, Marien Zwart) everything except TwistedEventLoop and + GLibEventLoop is supported + + * New experimental Terminal widget with xterm emulation and + terminal.py example program (by aszlig) + + * Edit widget now supports a mask (for passwords), has a + insert_text_result() method for full-field validation and + normalizes input text to Unicode or bytes based on the caption + type used + + * New TreeWidget, TreeNode, ParentNode, TreeWalker + and TreeListBox classes for lazy expanding/collapsing tree + views factored out of browse.py example program, with new + treesample.py example program (by Rob Lanphier) + + * MainLoop now calls draw_screen() just before going idle, so extra + calls to draw_screen() in user code may now be removed + + * New MainLoop.watch_pipe() method for subprocess or threaded + communication with the process/thread updating the UI, and new + subproc.py example demonstrating its use + + * New PopUpLauncher and PopUpTarget widgets and MainLoop option + for creating pop-ups and drop-downs, and new pop_up.py example + program + + * New twisted_serve_ssh.py example (by Ali Afshar) that serves + multiple displays over ssh from the same application using + Twisted and the TwistedEventLoop + + * ListBox now includes a get_cursor_coords() method, allowing + nested ListBox widgets + + * Columns widget contents may now be marked to always be treated + as flow widgets for mixing flow and box widgets more easily + + * New lcd_display module with support for CF635 USB LCD panel and + lcd_cf635.py example program with menus, slider controls and a custom + font + + * Shared command_map instance is now stored as Widget._command_map + class attribute and may be overridden in subclasses or individual + widgets for more control over special keystrokes + + * Overlay widget parameters may now be adjusted after creation with + set_overlay_parameters() method + + * New WidgetPlaceholder widget useful for swapping widgets without + having to manipulate a container widget's contents + + * LineBox widgets may now include title text + + * ProgressBar text content and alignment may now be overridden + + * Use reactor.stop() in TwistedEventLoop and document that Twisted's + reactor is not designed to be stopped then restarted + + * curses_display now supports AttrSpec and external event loops + (Twisted or GLib) just like raw_display + + * raw_display and curses_display now support the IBMPC character + set (currently only used by Terminal widget) + + * Fix for a gpm_mev bug preventing user input when on the console + + * Fix for leaks of None objects in str_util extension + + * Fix for WidgetWrap and AttrMap not working with fixed widgets + + * Fix for a lock up when attempting to wrap text containing wide + characters into a single character column + + +Urwid 0.9.9.2 +============= + +2011-07-13 + + * Fix for an Overlay get_cursor_coords(), and Text top-widget bug + + * Fix for a Padding rows() bug when used with width=PACK + + * Fix for a bug with large flow widgets used in an Overlay + + * Fix for a gpm_mev bug + + * Fix for Pile and GraphVScale when rendered with no contents + + * Fix for a Python 2.3 incompatibility (0.9.9 is the last release + to claim support Python 2.3) + + +Urwid 0.9.9.1 +============= + +2010-01-25 + + * Fix for ListBox snapping to selectable widgets taller than the + ListBox itself + + * raw_display switching to alternate buffer now works properly with + Terminal.app + + * Fix for BoxAdapter backwards incompatibility introduced in 0.9.9 + + * Fix for a doctest failure under powerpc + + * Fix for systems with gpm_mev installed but not running gpm + + +Urwid 0.9.9 +=========== + +2009-11-15 + + * New support for 256 and 88 color terminals with raw_display + and html_fragment display modules + + * New palette_test example program to demonstrate high color + modes + + * New AttrSpec class for specifying specific colors instead of + using attributes defined in the screen's palette + + * New MainLoop class ties together widgets, user input, screen + display and one of a number of new event loops, removing the + need for tedious, error-prone boilerplate code + + * New GLibEventLoop allows running Urwid applications with GLib + (makes D-Bus integration easier) + + * New TwistedEventLoop allows running Urwid with a Twisted reactor + + * Added new docstrings and doctests to many widget classes + + * New AttrMap widget supports mapping any attribute to any other + attribute, replaces AttrWrap widget + + * New WidgetDecoration base class for AttrMap, BoxAdapter, Padding, + Filler and LineBox widgets creates a common method for accessing + and updating their contained widgets + + * New left and right values may be specified in Padding widgets + + * New command_map for specifying which keys cause actions such as + clicking Button widgets and scrolling ListBox widgets + + * New tty_signal_keys() method of raw_display.Screen and + curses_display.Screen allows changing or disabling the keys used + to send signals to the application + + * Added helpful __repr__ for many widget classes + + * Updated all example programs to use MainLoop class + + * Updated tutorial with MainLoop usage and improved examples + + * Renamed WidgetWrap.w to _w, indicating its intended use as a way + to implement a widget with other widgets, not necessarily as + a container for other widgets + + * Replaced all tabs with 4 spaces, code is now more aerodynamic + (and PEP 8 compliant) + + * Added saving of stdin and stdout in raw_display module allowing + the originals to be redirected + + * Updated BigText widget's HalfBlock5x4Font + + * Fixed graph example CPU usage when animation is stopped + + * Fixed a memory leak related to objects listening for signals + + * Fixed a Popen3 deprecation warning + + +Urwid 0.9.8.4 +============= + +2009-03-13 + + * Fixed incompatibilities with Python 2.6 (by Friedrich Weber) + + * Fixed a SimpleListWalker with emptied list bug (found by Walter + Mundt) + + * Fixed a curses_display stop()/start() bug (found by Christian + Scharkus) + + * Fixed an is_wide_character() segfault on bad input data bug + (by Andrew Psaltis) + + * Fixed a CanvasCache with render() used in both a widget and its + superclass bug (found by Andrew Psaltis) + + * Fixed a ListBox.ends_visible() on empty list bug (found by Marc + Hartstein) + + * Fixed a tutorial example bug (found by Kurtis D. Rader) + + * Fixed an Overlay.keypress() bug (found by Andreas Klöckner) + + * Fixed setuptools configuration (by Andreas Klöckner) + + +Urwid 0.9.8.3 +============= + +2008-07-14 + + * Fixed a canvas cache memory leak affecting 0.9.8, 0.9.8.1 and + 0.9.8.2 (found by John Goodfellow) + + * Fixed a canvas fill_attr() bug (found by Joern Koerner) + + +Urwid 0.9.8.2 +============= + +2008-05-19 + + * Fixed incompatibilities with Python 2.3 + + * Fixed Pile cursor pref_col bug, WidgetWrap rows caching bug, Button + mouse_event with no callback bug, Filler body bug triggered by the + tutorial and a LineBox lline parameter typo. + + +Urwid 0.9.8.1 +============= + +2007-06-21 + + * Fixed a Filler render() bug, a raw_display start()/stop() bug and a + number of problems triggered by very small terminal window sizes. + + +Urwid 0.9.8 +=========== + +2007-03-23 + + * Rendering is now significantly faster. + + * New Widget base class for all widgets. It includes automatic caching + of rows() and render() methods. It also adds a new __super attribute + for accessing methods in superclasses. + + Widgets must now call self._invalidate() to notify the cache when + their content has changed. + + To disable caching in a widget set the class variable no_cache to a + list that includes the string "render". + + * Canvas classes have been reorganized: Canvas has been renamed to + TextCanvas and Canvas is now the base class for all canvases. New + canvas classes include BlankCanvas, SolidCanvas and CompositeCanvas. + + * External event loops may now be used with the raw_display module. The + new methods get_input_descriptors() and get_input_nonblocking() + should be used instead of get_input() to allow input processing + without blocking. + + * The Columns, Pile and ListBox widgets now choose their first + selectable child widget as the focus widget by defaut. + + * New ListWalker base class for list walker classes. + + * New Signals class that will be used to improve the existing event + callbacks. Currently it is used for ListWalker objects to notify + their ListBox when their content has changed. + + * SimpleListWalker now behaves as a list and supports all list + operations. This class now detects when changes are made to the list + and notifies the ListBox object. New code should use this class to + wrap lists of widgets before passing them to the ListBox + constructor. + + * New PollingListWalker class is now the default list walker that is + used when passing a simple list to the ListBox constructor. This + class is intended for backwards compatibility only. When this class + is used the ListBox object is unable to cache its render() method. + + * The curses_display module can now draw in the lower-right corner of + the screen. + + * All display modules now have start() and stop() methods that may be + used instead of calling run_wrapper(). + + * The raw_display module now uses an alternate buffer so that the + original screen can be restored on exit. The old behaviour is + available by seting the alternate_buffer parameter of start() or + run_wrapper() to False. + + * Many internal string processing functions have been rewritten in C to + improve their performance. + + * Compatible with Python >= 2.2. Python 2.1 is no longer supported. + + +Urwid 0.9.7.2 +============= + +2007-01-03 + + * Improved performance in UTF-8 mode when ASCII text is used. + + * Fixed a UTF-8 input bug. + + * Added a clear() function to the the display modules to force the + screen to be repainted on the next draw_screen() call. + + +Urwid 0.9.7.1 +============= + +2006-10-03 + + * Fixed bugs in Padding and Overlay widgets introduced in 0.9.7. + + +Urwid 0.9.7 +=========== + +2006-10-01 + + * Added initial support for fixed widgets - widgets that have a fixed + size on screen. Fixed widgets expect a size parameter equal to (). + Fixed widgets must implement the pack(..) function to return their + size. + + * New BigText class that draws text with fonts made of grids of + character cells. BigText is a fixed widget and doesn't do any + alignment or wrapping. It is intended for banners and number readouts + that need to stand out on the screen. + + Fonts: Thin3x3Font, Thin4x3Font, Thin6x6Font (full ascii) + + UTF-8 only fonts: HalfBlock5x4Font, HalfBlock6x5Font, + HalfBlockHeavy6x5Font, HalfBlock7x7Font (full ascii) + + New function get_all_fonts() may be used to get a list of the + available fonts. + + * New example program bigtext.py demonstrates use of BigText. + + * Padding class now has a clipping mode that pads or clips fixed + widgets to make them behave as flow widgets. + + * Overlay class can now accept a fixed widget as the widget to display + "on top". + + * New Canvas functions: pad_trim() and pad_trim_left_right(). + + * Fixed a bug in Filler.get_cursor_coords() that causes a crash if the + contained widget's get_cursor_coords() function returns None. + + * Fixed a bug in Text.pack() that caused an infinite loop when the text + contained a newline. This function is not currently used by Urwid. + + * Edit.__init__() now calls set_edit_text() to initialize its text. + + * Overlay.calculate_padding_filler() and Padding.padding_values() now + include focus parameters. + + +Urwid 0.9.6 +=========== + +2006-08-22 + + * Fixed Unicode conversion and locale issues when using Urwid with + Python < 2.4. The graph.py example program should now work properly + with older versions of Python. + + * The docgen_tutorial.py script can now write out the tutorial example + programs as individual files. + + * Updated reference documentation table of contents to show which + widgets are flow and/or box widgets. + + * Columns.set_focus(..) will now accept an integer or a widget as its + parameter. + + * Added detection for rxvt's HOME and END escape sequences. + + * Added support for setuptools (improved distutils). + + +Urwid 0.9.5 +=========== + +2006-06-14 + + * Some Unicode characters are now converted to use the G1 alternate + character set with DEC special and line drawing characters. These + Unicode characters should now "just work" in almost all terminals and + encodings. + + When Urwid is run with the UTF-8 encoding the characters are left as + UTF-8 and not converted. + + The characters converted are: + + \u00A3 (£), \u00B0 (°), \u00B1 (±), \u00B7 (·), \u03C0 (π), + \u2260 (≠), \u2264 (≤), \u2265 (≥), \u23ba (⎺), \u23bb (⎻), + \u23bc (⎼), \u23bd (⎽), \u2500 (─), \u2502 (│), \u250c (┌), + \u2510 (┐), \u2514 (└), \u2518 (┘), \u251c (├), \u2524 (┤), + \u252c (┬), \u2534 (┴), \u253c (┼), \u2592 (▒), \u25c6 (◆) + + * New SolidFill class for filling an area with a single character. + + * New LineBox class for wrapping widgets in a box made of line- drawing + characters. May be used as a box widget or a flow widget. + + * New example program graph.py demonstrates use of BarGraph, LineBox, + ProgressBar and SolidFill. + + * Pile class may now be used as a box widget and contain a mix of box + and flow widgets. + + * Columns class may now contain a mix of box and flow widgets. The box + widgets will take their height from the maximum height of the flow + widgets. + + * Improved the smoothness of resizing with raw_display module. The + module will now try to stop updating the screen when a resize event + occurs during the update. + + * The Edit and IntEdit classes now use their set_edit_text() and + set_edit_pos() functions when handling keypresses, so those functions + may be overridden to catch text modification. + + * The set_state() functions in the CheckBox and RadioButton classes now + have a do_callback parameter that determines if the callback function + registered will be called. + + * Fixed a newly introduced incompatibility with python < 2.3. + + * Fixed a missing symbol in curses_display when python is linked + against libcurses. + + * Fixed mouse handling bugs in the Frame and Overlay classes. + + * Fixed a Padding bug when the left or right has no padding. + + +Urwid 0.9.4 +=========== + +2006-05-30 + + * Enabled mouse handling across the Urwid library. + + Added a new mouse_event() method to the Widget interface definition + and to the following widgets: Edit, CheckBox, RadioButton, Button, + GridFlow, Padding, Filler, Overlay, Frame, Pile, Columns, BoxAdapter + and ListBox. + + Updated example programs browse.py, calc.py, dialog.py, edit.py and + tour.py to support mouse input. + + * Released the files used to generate the reference and tutorial + documentation: docgen_reference.py, docgen_tutorial.py and + tmpl_tutorial.html. The "docgen" scripts write the documentation to + stdout. docgen_tutorial.py requires the Templayer HTML templating + library to run: http://excess.org/templayer/ + + * Improved Widget and List Walker interface documentation. + + * Fixed a bug in the handling of invalid UTF-8 data. All invalid + characters are now replaced with '?' characters when displayed. + + +Urwid 0.9.3 +=========== + +2006-05-14 + + * Improved mouse reporting. + + The raw_display module now detects gpm mouse events by reading + /usr/bin/mev output. The curses_display module already supports gpm + directly. + + Mouse drag events are now reported by raw_display in terminals that + provide button event tracking and on the console with gpm. Note that + gpm may report coordinates off the screen if the user drags the mouse + off the edge. + + Button release events now report which button was released if that + information is available, currently only on the console with gpm. + + * Added display of raw keycodes to the input_test.py example program. + + * Fixed a text layout bug affecting clipped text with blank lines, and + another related to wrapped text starting with a space character. + + * Fixed a Frame.keypress() bug that caused it to call keypress on + unselectable widgets. + + +Urwid 0.9.2 +=========== + +2006-03-18 + + * Preliminary mouse support was added to the raw_display and + curses_display modules. A new Screen.set_mouse_tracking() method was + added to enable mouse tracking. Mouse events are returned alongside + keystrokes from the Screen.get_input() method. + + The widget interface does not yet include mouse handling. This will + be addressed in the next release. + + * A new convenience function is_mouse_event() was added to help in + separating mouse events from keystrokes. + + * Added a new example program input_test.py. This program displays the + keyboard and mouse input it receives. It may be run as a CGI script + or from the command line. On the command line it defaults to using + the curses_display module, use input_test.py raw to use the + raw_display module instead. + + * Fixed an Edit.render() bug that caused it to render the cursor in a + different location than that reported by Edit.get_cursor_coords() in + some circumstances. + + * Fixed a bug preventing use of UTF-8 characters with Divider widgets. + + +Urwid 0.9.1 +=========== + +2006-03-06 + + * BarGraph and ProgressBar can now display data more accurately by + using the UTF-8 vertical and horizontal eighth characters. This + behavior will be enabled when the UTF-8 encoding is detected and + "smoothed" attributes are passed to the BarGraph or ProgressBar + constructors. + + * New get_encoding_mode() function to determine how Urwid will treat + raw string data. + + * New raw_display.signal_init() and raw_display.signal_restore() + methods that may be overridden by threaded applications that need to + call signal.signal() from their main thread. + + * Fixed a bug that prevented the use of UTF-8 strings in text markup. + + * Removed some forgotten asserts that broke 8-bit and CJK input. + + +Urwid 0.9.0 +=========== + +2006-02-18 + + * New support for UTF-8 encoding including input, display and editing + of narrow and wide (CJK) characters. + + Preliminary combining (zero-width) character support is included, but + full support will require terminal behavior detection. + + Right-to-Left input and display are not implemented. + + * New raw_display module that handles console display without relying + on external libraries. This module was written as a work around for + the lack of UTF-8 support in the standard version of ncurses. + + Eliminates "dead corner" in the bottom right of the screen. + + Avoids use of bold text in xterm and gnome-terminal for improved + text legibility. + + * Fixed Overlay bug related to UTF-8 handling. + + * Fixed Edit.move_cursor_to_coords(..) bug related to wide characters + in UTF-8 encoding. + + +Urwid 0.9.0-pre3 +================ + +2006-02-13 + + * Fixed Canvas attribute padding bug related to -pre1 changes. + + +Urwid 0.9.0-pre2 +================ + +2006-02-10 + + * Replaced the custom align and wrap modes in example program calc.py + with a new layout class. + + * Fixed Overlay class call to Canvas.overlay() broken by -pre1 changes. + + * Fixed Padding bug related to Canvas -pre1 changes. + + +Urwid 0.9.0-pre1 +================ + +2006-02-08 + + * New support for UTF-8 encoding. Unicode strings may be used and will + be converted to the current encoding when output. Regular strings in + the current encoding may still be used. + + PLEASE NOTE: There are issues related to displaying UTF-8 characters + with the curses_display module that have not yet been resolved. + + * New set_encoding() function replaces util.set_double_byte_encoding(). + + * New supports_unicode() function to query if unicode strings with + characters outside the ascii range may be used with the current + encoding. + + * New TextLayout and StandardTextLayout classes to perform text + wrapping and alignment. Text widgets now have a layout parameter to + allow use of custom TextLayout objects. + + * New layout structure replaces line translation structure. Layout + structure now allows arbitrary reordering/positioning of text + segments, inclusion of UTF-8 characters and insertion of text not + found in the original text string. + + * Removed util.register_align_mode() and util.register_wrap_mode(). + Their functionality has been replaced by the new layout classes. + + +Urwid 0.8.10 +============ + +2005-11-27 + + * Expanded tutorial to cover advanced ListBox usage, custom widget + classes and the Pile, BoxAdapter, Columns, GridFlow and Overlay + classes. + + * Added escape sequence for "shift tab" to curses_display. + + * Added ListBox.set_focus_valign() to allow positioning of the focus + widget within the ListBox. + + * Added WidgetWrap class for extending existing widgets without + inheriting their complete namespace. + + * Fixed web_display/mozilla breakage from 0.8.9. Fixed crash on invalid + locale setting. Fixed ListBox slide-back bug. Fixed improper space + trimming in calculate_alignment(). Fixed browse.py example program + rows bug. Fixed sum definition, use of long ints for python2.1. Fixed + warnings with python2.1. Fixed Padding.get_pref_col() bug. Fixed + Overlay splitting CJK characters bug. + + +Urwid 0.8.9 +=========== + +2005-10-21 + + * New Overlay class for drawing widgets that obscure parts of other + widgets. May be used for drop down menus, combo boxes, overlapping + "windows", caption text etc. + + * New BarGraph, GraphVScale and ProgressBar classes for graphical + display of data in Urwid applications. + + * New method for configuring keyboard input timeouts and delays: + curses_display.Screen.set_input_timeouts(). + + * Fixed a ListBox.set_focus() bug. + + +Urwid 0.8.8 +=========== + +2005-06-13 + + * New web_display module that emulates a console display within a web + browser window. Application must be run as a CGI script under Apache. + + Supports font/window resizing, keepalive for long-lived connections, + limiting maximum concurrent connections, polling and connected update + methods. Tested with Mozilla Firefox and Internet Explorer. + + * New BoxAdapter class for using box widgets in places that usually + expect flow widgets. + + * New curses_display input handling with better ESC key detection and + broader escape code support. + + * Shortened resize timeout on gradual resize to improve responsiveness. + + +Urwid 0.8.7 +=========== + +2005-05-21 + + * New widget classes: Button, RadioButton, CheckBox. + + * New layout widget classes: Padding, GridFlow. + + * New dialog.py example program that behaves like dialog(1) command. + + * Pile widgets now support selectable items, focus changing with up and + down keys and setting the cursor position. + + * Frame widgets now support selectable items in the header and footer. + + * Columns widgets now support fixed width and relative width columns, a + minimum width for all columns, selectable items within columns + containing flow widgets (already supported for box widgets), focus + changing with left and right keys and setting the cursor position. + + * Filler widgets may now wrap box widgets and have more alignment options. + + * Updated tour.py example program to show new widget types and + features. + + * Avoid hogging cpu on gradual window resize and fix for slow resize + with cygwin's broken curses implementation. + + * Fixed minor CJK problem and curs_set() crash under MacOSX and Cygwin. + + * Fixed crash when deleting cells in calc.py example program. + + +Urwid 0.8.6 +=========== + +2005-01-03 + + * Improved support for CJK double-byte encodings: BIG5, UHC, GBK, + GB2312, CN-GB, EUC-KR, EUC-CN, EUC-JP (JISX 0208 only) and EUC-TW + (CNS 11643 plain 1 only) + + * Added support for ncurses' use_default_colors() function to + curses_display module (Python >= 2.4). + + register_palette() and register_palette_entry() now accept "default" + as foreground and/or background. If the terminal's default attributes + cannot be detected black on light gray will be used to accomodate + terminals with always-black cursors. + + "default" is now the default for text with no attributes. This means + that areas with no attributes will change from light grey on black + (curses default) to black on light gray or the terminal's default. + + * Modified examples to not use black as background of Edit widgets. + + * Fixed curses_display curs_set() call so that cursor is hidden when + widget in focus has no cursor position. + + +Urwid 0.8.5 +=========== + +2004-12-15 + + * New tutorial covering basic operation of: curses_display.Screen, + Canvas, Text, FlowWidget, Filler, BoxWidget, AttrWrap, Edit, ListBox + and Frame classes + + * New widget class: Filler + + * New ListBox functions: get_focus(), set_focus() + + * Debian packages for Python 2.4. + + * Fixed curses_display bug affecting text with no attributes. + + +Urwid 0.8.4 +=========== + +2004-11-20 + + * Improved support for Cyrillic and other simple 8-bit encodings. + + * Added new functions to simplify taking screenshots: + html_fragment.screenshot_init() and + html_fragment.screenshot_collect() + + * Improved urwid/curses_display.py input debugging + + * Fixed cursor in screenshots of CJK text. Fixed "end" key in Edit + boxes with CJK text. + + +Urwid 0.8.3 +=========== + +2004-11-15 + + * Added support for CJK double-byte encodings. + + Word wrapping mode "space" will wrap on edges of double width + characters. Wrapping and clipping will not split double width + characters. + + curses_display.Screen.get_input() may now return double width + characters. Text and Edit classes will work with a mix of regular and + double width characters. + + * Use new method Edit.set_edit_text() instead of Edit.update_text(). + + * Minor improvements to edit.py example program. + + +Urwid 0.8.2 +=========== + +2004-11-08 + + * Re-released under GNU Lesser General Public License. + + +Urwid 0.8.1 +=========== + +2004-10-29 + + * Added support for monochrome terminals. see + curses_display.Screen.register_palette_entry() and example programs. + set TERM=xterm-mono to test programs in monochrome mode. + + * Added unit testing code test_urwid.py to the examples. + + * Can now run urwid/curses_display.py to test your terminal's input and + colour rendering. + + * Fixed an OSX browse.py compatibility issue. Added some OSX keycodes. + + +Urwid 0.8.0 +=========== + +2004-10-17 + + * Initial Release diff --git a/docs/conf.py b/docs/conf.py index e612f89..302dff0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,7 +41,7 @@ master_doc = 'index' # General information about the project. project = u'Urwid' -copyright = u'2012, Ian Ward' +copyright = u'2014, Ian Ward et al' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -119,7 +119,7 @@ html_theme_options = { # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". -html_title = "Urwid %s Documentation" % (release,) +html_title = "Urwid %s" % (release,) # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None @@ -268,7 +268,7 @@ texinfo_documents = [ epub_title = u'Urwid' epub_author = u'Ian Ward' epub_publisher = u'Ian Ward' -epub_copyright = u'2012, Ian Ward' +epub_copyright = u'2014, Ian Ward et al' # The language of the text. It defaults to the language option # or en if the language is not set. diff --git a/docs/examples/bigtext.py b/docs/examples/bigtext.py new file mode 120000 index 0000000..119650d --- /dev/null +++ b/docs/examples/bigtext.py @@ -0,0 +1 @@ +../../examples/bigtext.py
\ No newline at end of file diff --git a/docs/examples/bigtext.py.xdotool b/docs/examples/bigtext.py.xdotool new file mode 100644 index 0000000..d245b08 --- /dev/null +++ b/docs/examples/bigtext.py.xdotool @@ -0,0 +1,3 @@ +windowsize --usehints $RXVTWINDOWID 39 21 +key --window $RXVTWINDOWID BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace BackSpace e x a m p l e Down Down Down Down Down Down Return +key --window $RXVTWINDOWID Up Up Up Return diff --git a/docs/examples/bigtext1.png b/docs/examples/bigtext1.png Binary files differnew file mode 100644 index 0000000..2598916 --- /dev/null +++ b/docs/examples/bigtext1.png diff --git a/docs/examples/bigtext2.png b/docs/examples/bigtext2.png Binary files differnew file mode 100644 index 0000000..1e9906b --- /dev/null +++ b/docs/examples/bigtext2.png diff --git a/docs/examples/bigtext3.png b/docs/examples/bigtext3.png Binary files differnew file mode 100644 index 0000000..5ab0e37 --- /dev/null +++ b/docs/examples/bigtext3.png diff --git a/docs/examples/browse.py b/docs/examples/browse.py new file mode 100755 index 0000000..2bbcc34 --- /dev/null +++ b/docs/examples/browse.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +import real_browse +import os +os.chdir('/usr/share/doc/python') +real_browse.main() diff --git a/docs/examples/browse.py.xdotool b/docs/examples/browse.py.xdotool new file mode 100644 index 0000000..c722435 --- /dev/null +++ b/docs/examples/browse.py.xdotool @@ -0,0 +1,2 @@ +windowsize --usehints $RXVTWINDOWID 79 19 +key --window $RXVTWINDOWID Down plus Down space Down space Down Down Down diff --git a/docs/examples/browse1.png b/docs/examples/browse1.png Binary files differnew file mode 100644 index 0000000..857903a --- /dev/null +++ b/docs/examples/browse1.png diff --git a/docs/examples/browse2.png b/docs/examples/browse2.png Binary files differnew file mode 100644 index 0000000..3dc5ba2 --- /dev/null +++ b/docs/examples/browse2.png diff --git a/docs/examples/edit.py b/docs/examples/edit.py new file mode 100755 index 0000000..7eacc86 --- /dev/null +++ b/docs/examples/edit.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +import sys +import os +import real_edit + +real_edit.EditDisplay(os.path.join( + os.path.dirname(sys.argv[0]), 'edit_text.txt')).main() diff --git a/docs/examples/edit.py.xdotool b/docs/examples/edit.py.xdotool new file mode 100644 index 0000000..70ba7a8 --- /dev/null +++ b/docs/examples/edit.py.xdotool @@ -0,0 +1,2 @@ +windowsize --usehints $RXVTWINDOWID 39 20 +key --window $RXVTWINDOWID Return Return a d d i n g space s o m e space t e x t space diff --git a/docs/examples/edit1.png b/docs/examples/edit1.png Binary files differnew file mode 100644 index 0000000..6a3ba42 --- /dev/null +++ b/docs/examples/edit1.png diff --git a/docs/examples/edit2.png b/docs/examples/edit2.png Binary files differnew file mode 100644 index 0000000..165695f --- /dev/null +++ b/docs/examples/edit2.png diff --git a/docs/examples/edit_text.txt b/docs/examples/edit_text.txt new file mode 100644 index 0000000..c0947b3 --- /dev/null +++ b/docs/examples/edit_text.txt @@ -0,0 +1,11 @@ +替洼渎溏潺瀚灯烫虫调达逯遘醋长闫阚顺驼髓 +공곽껫끓뇽늙등뗍뛴룸많맹뫘볶 +ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში. + ╔══════════════════════╗ + ║ • “smart quotes” ║ + ║ ╭─────────╮ ║ + ║ • euro: │ € 14.95 │ ║ + ║ ╰─────────╯ ║ + ╚══════════════════════╝ +Math: ∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i), ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β) + diff --git a/docs/examples/graph.py b/docs/examples/graph.py new file mode 120000 index 0000000..ffbbea0 --- /dev/null +++ b/docs/examples/graph.py @@ -0,0 +1 @@ +../../examples/graph.py
\ No newline at end of file diff --git a/docs/examples/graph.py.xdotool b/docs/examples/graph.py.xdotool new file mode 100644 index 0000000..0abaa5a --- /dev/null +++ b/docs/examples/graph.py.xdotool @@ -0,0 +1,2 @@ +windowsize --usehints $RXVTWINDOWID 79 24 +key --window $RXVTWINDOWID Down Down Down Return diff --git a/docs/examples/graph1.png b/docs/examples/graph1.png Binary files differnew file mode 100644 index 0000000..1cf14fa --- /dev/null +++ b/docs/examples/graph1.png diff --git a/docs/examples/graph2.png b/docs/examples/graph2.png Binary files differnew file mode 100644 index 0000000..888c610 --- /dev/null +++ b/docs/examples/graph2.png diff --git a/docs/examples/index.rst b/docs/examples/index.rst new file mode 100644 index 0000000..0141b64 --- /dev/null +++ b/docs/examples/index.rst @@ -0,0 +1,80 @@ +.. _example-programs: + +******************** + Example Programs +******************** + +.. currentmodule:: urwid + +These example programs may be found in the examples directory of your +Urwid distribution. + +tour.py +------- + +.. image:: tour1.png +.. image:: tour2.png + +Show how many of the standard widgets may be arranged +on the screen + + +graph.py +-------- + +.. image:: graph2.png + +Demonstrate BarGraph widget and alarms used for animation + + +edit.py +------- + +.. image:: edit1.png +.. image:: edit2.png + +A simple text editor with lazy loading + + +browse.py +--------- + +.. image:: browse2.png + +A lazy directory browser with file selection, tree-view, custom widgets +and list walker + + +subproc.py +---------- + +.. image:: subproc1.png +.. image:: subproc2.png + +Monitor and display results from a subprocess + + +palette_test.py +--------------- + +.. image:: palette_test2.png + +Show available colors in various screen modes + + +pop_up.py +--------- + +.. image:: pop_up1.png +.. image:: pop_up2.png + +Create a pop-up/drop-down/window anchored to another widget + + +bigtext.py +---------- + +.. image:: bigtext2.png +.. image:: bigtext3.png + +demonstrate the BigText widget diff --git a/docs/examples/palette_test.py b/docs/examples/palette_test.py new file mode 120000 index 0000000..0ab2544 --- /dev/null +++ b/docs/examples/palette_test.py @@ -0,0 +1 @@ +../../examples/palette_test.py
\ No newline at end of file diff --git a/docs/examples/palette_test.py.xdotool b/docs/examples/palette_test.py.xdotool new file mode 100644 index 0000000..ed97821 --- /dev/null +++ b/docs/examples/palette_test.py.xdotool @@ -0,0 +1,2 @@ +windowsize --usehints $RXVTWINDOWID 79 34 +key --window $RXVTWINDOWID Down Down Down Return Right Down Return diff --git a/docs/examples/palette_test1.png b/docs/examples/palette_test1.png Binary files differnew file mode 100644 index 0000000..4a5c392 --- /dev/null +++ b/docs/examples/palette_test1.png diff --git a/docs/examples/palette_test2.png b/docs/examples/palette_test2.png Binary files differnew file mode 100644 index 0000000..64a9e46 --- /dev/null +++ b/docs/examples/palette_test2.png diff --git a/docs/examples/pop_up.py b/docs/examples/pop_up.py new file mode 120000 index 0000000..0e32494 --- /dev/null +++ b/docs/examples/pop_up.py @@ -0,0 +1 @@ +../../examples/pop_up.py
\ No newline at end of file diff --git a/docs/examples/pop_up.py.xdotool b/docs/examples/pop_up.py.xdotool new file mode 100644 index 0000000..486ab8d --- /dev/null +++ b/docs/examples/pop_up.py.xdotool @@ -0,0 +1,2 @@ +windowsize --usehints $RXVTWINDOWID 39 18 +key --window $RXVTWINDOWID space diff --git a/docs/examples/pop_up1.png b/docs/examples/pop_up1.png Binary files differnew file mode 100644 index 0000000..9371d54 --- /dev/null +++ b/docs/examples/pop_up1.png diff --git a/docs/examples/pop_up2.png b/docs/examples/pop_up2.png Binary files differnew file mode 100644 index 0000000..ac0bd53 --- /dev/null +++ b/docs/examples/pop_up2.png diff --git a/docs/examples/real_browse.py b/docs/examples/real_browse.py new file mode 120000 index 0000000..a817177 --- /dev/null +++ b/docs/examples/real_browse.py @@ -0,0 +1 @@ +../../examples/browse.py
\ No newline at end of file diff --git a/docs/examples/real_edit.py b/docs/examples/real_edit.py new file mode 120000 index 0000000..16bf719 --- /dev/null +++ b/docs/examples/real_edit.py @@ -0,0 +1 @@ +../../examples/edit.py
\ No newline at end of file diff --git a/docs/examples/subproc.py b/docs/examples/subproc.py new file mode 120000 index 0000000..b3410f7 --- /dev/null +++ b/docs/examples/subproc.py @@ -0,0 +1 @@ +../../examples/subproc.py
\ No newline at end of file diff --git a/docs/examples/subproc.py.xdotool b/docs/examples/subproc.py.xdotool new file mode 100644 index 0000000..4f8e186 --- /dev/null +++ b/docs/examples/subproc.py.xdotool @@ -0,0 +1,2 @@ +windowsize --usehints $RXVTWINDOWID 39 18 +key --window $RXVTWINDOWID a n y t h i n g question diff --git a/docs/examples/subproc1.png b/docs/examples/subproc1.png Binary files differnew file mode 100644 index 0000000..6e515fa --- /dev/null +++ b/docs/examples/subproc1.png diff --git a/docs/examples/subproc2.png b/docs/examples/subproc2.png Binary files differnew file mode 100644 index 0000000..86fb0ec --- /dev/null +++ b/docs/examples/subproc2.png diff --git a/docs/examples/subproc2.py b/docs/examples/subproc2.py new file mode 100644 index 0000000..76c8090 --- /dev/null +++ b/docs/examples/subproc2.py @@ -0,0 +1,10 @@ + +import time +time.sleep(1) + +print """factor: 1 +factor: 1000003 +factor: 2000029 +factor: 3000073 +factor: 4000159 +factor: 5000101""" diff --git a/docs/examples/tour.py b/docs/examples/tour.py new file mode 120000 index 0000000..84d7931 --- /dev/null +++ b/docs/examples/tour.py @@ -0,0 +1 @@ +../../examples/tour.py
\ No newline at end of file diff --git a/docs/examples/tour.py.xdotool b/docs/examples/tour.py.xdotool new file mode 100644 index 0000000..8c1ddea --- /dev/null +++ b/docs/examples/tour.py.xdotool @@ -0,0 +1,2 @@ +windowsize --usehints $RXVTWINDOWID 39 25 +key --window $RXVTWINDOWID Return Page_Down Page_Down Page_Down Page_Down Page_Down diff --git a/docs/examples/tour1.png b/docs/examples/tour1.png Binary files differnew file mode 100644 index 0000000..d97c8b8 --- /dev/null +++ b/docs/examples/tour1.png diff --git a/docs/examples/tour2.png b/docs/examples/tour2.png Binary files differnew file mode 100644 index 0000000..d5c4ab8 --- /dev/null +++ b/docs/examples/tour2.png diff --git a/docs/index.rst b/docs/index.rst index 4a6bb3d..66050c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,6 +4,8 @@ Urwid |release| Documentation .. toctree:: + examples/index tutorial/index manual/index reference/index + changelog diff --git a/docs/manual/bright_combinations.py b/docs/manual/bright_combinations.py new file mode 100755 index 0000000..4ff350c --- /dev/null +++ b/docs/manual/bright_combinations.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +import urwid + +RED_FGS = ('black', 'light gray', 'white', 'light cyan', 'light red', + 'light green', 'yellow', 'light magenta') +GREEN_FGS = ('black', 'light gray', 'dark blue', 'white', 'light cyan', + 'light red', 'light green', 'yellow') +BROWN_FGS = ('black', 'dark blue', 'dark gray', 'white', + 'light blue', 'light cyan', 'light red', 'light green', 'yellow') +MAGENTA_FGS = ('black', 'light gray', 'dark blue', 'white', 'light cyan', + 'light red', 'light green', 'yellow', 'light magenta') + +BG_FGS =[ + ('dark red', RED_FGS), + ('dark green', GREEN_FGS), + ('brown', BROWN_FGS), + ('dark magenta', MAGENTA_FGS), + ] + +body = urwid.SimpleFocusListWalker([]) + +for bg, fgs in BG_FGS: + spec = urwid.AttrSpec(fgs[0], bg) + def s(w): + return urwid.AttrMap(w, spec) + body.append(s(urwid.Divider())) + body.append(s( + urwid.GridFlow( + [urwid.AttrMap(urwid.Text("'{0}' on '{1}'".format(fg, bg)), + urwid.AttrSpec(fg, bg)) for fg in fgs], + 35, 0, 0, 'left'))) + body.append(s(urwid.Divider())) + +urwid.MainLoop(urwid.ListBox(body)).run() diff --git a/docs/manual/bright_combinations.py.xdotool b/docs/manual/bright_combinations.py.xdotool new file mode 100644 index 0000000..fd929d8 --- /dev/null +++ b/docs/manual/bright_combinations.py.xdotool @@ -0,0 +1 @@ +windowsize --usehints $RXVTWINDOWID 70 26 diff --git a/docs/manual/bright_combinations1.png b/docs/manual/bright_combinations1.png Binary files differnew file mode 100644 index 0000000..d46c920 --- /dev/null +++ b/docs/manual/bright_combinations1.png diff --git a/docs/manual/canvascache.rst b/docs/manual/canvascache.rst index 0dd4271..bb5f094 100644 --- a/docs/manual/canvascache.rst +++ b/docs/manual/canvascache.rst @@ -12,7 +12,7 @@ visible, unchanged canvases so that not all of the visible widgets need to be rendered for each update. The :class:`Widget` base class uses some metaclass magic to -capture the canvas objects returned :meth:`Widget.render` is called and return +capture the canvas objects returned when :meth:`Widget.render` is called and return them the next time :meth:`Widget.render` is called again with the same parameters. The :meth:`Widget._invalidate` method is provided as a way to remove cached widgets so that changes to the widget are visible the next time the screen is redrawn. @@ -26,7 +26,7 @@ Composite Canvases When container and decoration widgets are rendered, they collect the canvases returned by their children and arrange them into a composite canvas. Composite -canvases may are nested to form a tree with the topmost widget's :meth:`Widget.render` +canvases are nested to form a tree with the topmost widget's :meth:`Widget.render` method returning the root of the tree. That canvas is sent to the display module to be rendered on the screen. diff --git a/docs/manual/displayattributes.rst b/docs/manual/displayattributes.rst index 9492869..44b7753 100644 --- a/docs/manual/displayattributes.rst +++ b/docs/manual/displayattributes.rst @@ -334,3 +334,30 @@ terminal, so this feature shouldn't be relied on. :meth:`raw_display.Screen.reset_default_terminal_palette` is used to reset the palette in the ``palette_test.py`` example program when switching modes. + +Recommended Combinations +======================== + +Neutral Backgrounds +------------------- + +.. image:: safe_combinations1.png + +Choose colors that are fairly neutral with medium contrast for most of +your application. It is good to use one background as a default for text, +another for edit boxes and a third for selected edit boxes. + +Foreground colors shown here in bold text will appear as bold text on +many terminals. Bold fonts are often more difficult to read so those +foreground colours should be used sparingly. + +Bright Backgrounds +------------------ + +.. image:: bright_combinations1.png + +Use bright colors to draw attention to small areas with important +information. They are good for buttons and selected widgets (other than +edit boxes). + + diff --git a/docs/manual/displaymodules.rst b/docs/manual/displaymodules.rst index c31d417..eba84c8 100644 --- a/docs/manual/displaymodules.rst +++ b/docs/manual/displaymodules.rst @@ -92,7 +92,7 @@ Screenshot Display Module ``html_fragment`` Screenshots of Urwid interfaces can be rendered in plain HTML. The :class:`html_fragment.HtmlGenerator` display module lets you do this by simulating user input and capturing the screen as fragments of HTML each time -:meth:`html_fragemnt.HtmlGenerator.draw_screen` is +:meth:`html_fragment.HtmlGenerator.draw_screen` is called. These fragments may be included in HTML documents. They will be rendered diff --git a/docs/manual/mainloop.rst b/docs/manual/mainloop.rst index e34c6c5..ee3f62a 100644 --- a/docs/manual/mainloop.rst +++ b/docs/manual/mainloop.rst @@ -59,7 +59,8 @@ Event Loops Urwid's event loop classes handle waiting for things for the :class:`MainLoop`. The different event loops allow you to -integrate with Twisted_ or Glib_ libraries, or use a simple ``select``-based +integrate with Twisted_, Glib_, Tornado_ libraries, +or use a simple ``select``-based loop. Event loop classes abstract the particulars of waiting for input and calling functions as a result of timeouts. @@ -69,10 +70,12 @@ you have more than one :class:`MainLoop` running. You can add your own files to watch to your event loop, with the :meth:`watch_file() <SelectEventLoop.watch_file>` method. Using this interface gives you the special handling -of :exc:`ExitMainLoop` and other exceptions when using Glib_ or Twisted_. +of :exc:`ExitMainLoop` and other exceptions when using Glib_, Twisted_ or +Tornado_ callbacks. .. _Twisted: http://twistedmatrix.com/trac/ .. _Glib: http://developer.gnome.org/glib/stable/ +.. _Tornado: http://www.tornadoweb.org/ ``SelectEventLoop`` ------------------- @@ -120,3 +123,18 @@ application on Twisted. .. seealso:: :class:`GLibEventLoop reference <GLibEventLoop>` + +``TornadoEventLoop`` +-------------------- + +This event loop integrates with Tornado. + +:: + + from tornado.ioloop import IOLoop + evl = urwid.TornadoEventLoop(IOLoop() + loop = urwid.MainLoop(widget, event_loop=evl) + +.. seealso:: + + :class`TornadoEventLoop reference <TornadoEventLoop>` diff --git a/docs/manual/safe_combinations.py b/docs/manual/safe_combinations.py new file mode 100755 index 0000000..5a02159 --- /dev/null +++ b/docs/manual/safe_combinations.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python + +import urwid + +BLACK_FGS = ('light gray', 'dark cyan', 'dark red', 'dark green', + 'dark magenta', 'white', 'light blue', 'light cyan', 'light red', + 'light green', 'yellow', 'light magenta') +GRAY_FGS = ('black', 'dark blue', 'dark cyan', 'dark red', 'dark green', + 'dark magenta', 'white', 'light red', 'yellow', + 'light magenta') +BLUE_FGS = ('light gray', 'dark cyan', 'white', + 'light cyan', 'light red', 'light green', 'yellow', + 'light magenta') +CYAN_FGS = ('black', 'light gray', 'dark blue', 'white', 'light cyan', + 'light green', 'yellow') + +BG_FGS =[ + ('black', BLACK_FGS), + ('light gray', GRAY_FGS), + ('dark blue', BLUE_FGS), + ('dark cyan', CYAN_FGS), + ] + +body = urwid.SimpleFocusListWalker([]) + +for bg, fgs in BG_FGS: + spec = urwid.AttrSpec(fgs[0], bg) + def s(w): + return urwid.AttrMap(w, spec) + body.append(s(urwid.Divider())) + body.append(s( + urwid.GridFlow( + [urwid.AttrMap(urwid.Text("'{0}' on '{1}'".format(fg, bg)), + urwid.AttrSpec(fg, bg)) for fg in fgs], + 35, 0, 0, 'left'))) + body.append(s(urwid.Divider())) + +urwid.MainLoop(urwid.ListBox(body)).run() diff --git a/docs/manual/safe_combinations.py.xdotool b/docs/manual/safe_combinations.py.xdotool new file mode 100644 index 0000000..c1b7590 --- /dev/null +++ b/docs/manual/safe_combinations.py.xdotool @@ -0,0 +1 @@ +windowsize --usehints $RXVTWINDOWID 70 27 diff --git a/docs/manual/safe_combinations1.png b/docs/manual/safe_combinations1.png Binary files differnew file mode 100644 index 0000000..a5c7d7e --- /dev/null +++ b/docs/manual/safe_combinations1.png diff --git a/docs/manual/widgets.rst b/docs/manual/widgets.rst index 0e42c52..44fe7d3 100644 --- a/docs/manual/widgets.rst +++ b/docs/manual/widgets.rst @@ -29,7 +29,7 @@ screen. When we render the topmost widget: 7. *(a)* possibly modifies the canvas from *(b)* and returns it Widgets *(a)*, *(b)* and *(e)* are called container widgets because they -contain other widgets. Container widgets choose the size and position their +contain other widgets. Container widgets choose the size and position of their contained widgets. Container widgets must also keep track of which one of their contained widgets @@ -315,7 +315,7 @@ or pop-up menus. The Overlay widget always treats the top widget as the one in focus. All keyboard input will be passed to the top widget. -If you want to use a flow flow widget for the top widget, first wrap the flow +If you want to use a flow widget for the top widget, first wrap the flow widget with a :class:`Filler` widget. diff --git a/docs/reference/main_loop.rst b/docs/reference/main_loop.rst index dfde825..48b1c4f 100644 --- a/docs/reference/main_loop.rst +++ b/docs/reference/main_loop.rst @@ -23,3 +23,8 @@ TwistedEventLoop .. autoclass:: TwistedEventLoop +TornadoEventLoop +---------------- + +.. autoclass:: TornadoEventLoop + diff --git a/docs/reference/signals.rst b/docs/reference/signals.rst index cbcbf37..9e10f94 100644 --- a/docs/reference/signals.rst +++ b/docs/reference/signals.rst @@ -7,11 +7,15 @@ The :func:`urwid.\*_signal` functions use a shared Signals object instance for tracking registered and connected signals. There is no reason to instantiate your own Signals object. -.. function:: connect_signal(obj, name, callback, user_arg=None) +.. function:: connect_signal(obj, name, callback, user_arg=None, weak_args=None, user_args=None) .. automethod:: Signals.connect -.. function:: disconnect_signal(obj, name, callback, user_arg=None) +.. function:: disconnect_by_key(obj, name, key) + +.. automethod:: Signals.disconnect_by_key + +.. function:: disconnect_signal(obj, name, callback, user_arg=None, weak_args=None, user_args=None) .. automethod:: Signals.disconnect diff --git a/docs/tools/compile_pngs.sh b/docs/tools/compile_pngs.sh index 1d078a8..f9135e9 100755 --- a/docs/tools/compile_pngs.sh +++ b/docs/tools/compile_pngs.sh @@ -2,7 +2,7 @@ # args: scripts to capture -DISPLAYNUM=1 +DISPLAYNUM=5 SCREENSHOTS=`dirname $0`/screenshots.sh XVFB=$(which Xvfb) @@ -14,6 +14,7 @@ if [ -n $XVFB ]; then fi for script in $@; do + echo "doing $script" if [ -f "${script}.xdotool" ]; then "$SCREENSHOTS" "$script" < "${script}.xdotool" fi diff --git a/docs/tools/screenshots.sh b/docs/tools/screenshots.sh index 5d2b04d..db7ca11 100755 --- a/docs/tools/screenshots.sh +++ b/docs/tools/screenshots.sh @@ -20,6 +20,7 @@ c=1 while read -r line; do # the echo trick is needed to expand RXVTWINDOWID variable echo $line | xdotool - + echo "sending $line" import -window "$RXVTWINDOWID" "${image}$c.png" (( c++ )) done diff --git a/docs/tools/templates/indexcontent.html b/docs/tools/templates/indexcontent.html index 13dc2b5..784cd83 100644 --- a/docs/tools/templates/indexcontent.html +++ b/docs/tools/templates/indexcontent.html @@ -1,29 +1,73 @@ {% extends "!defindex.html" %} {% block body %} -<h1>Urwid {{ release }} Documentation</h1> +<h1>Urwid{% if 'dev' in release %} development version{% endif %}</h1> +<div style="float: left; width: 500px;"> +<p>Console user interface library for Python</p> -<div class="section" id="tutorial"> -<h2><a class="reference internal" href="tutorial/index.html#urwid-tutorial"><em>Tutorial</em></a><a class="headerlink" href="#tutorial" title="Permalink to this headline">¶</a></h2> -<a class="reference external image-reference" href="tutorial/index.html#urwid-tutorial"><img alt="_images/highcolors1.png" src="_images/highcolors1.png" width="200" align="left" style="padding-right: 15px" /></a> -<p>The <a class="reference internal" href="tutorial/index.html#urwid-tutorial"><em>Urwid Tutorial</em></a> covers example Urwid applications -from basic to moderate complexity. Each new concept is explained along the way.</p> +<ul> +{% if 'dev' in release %}<li>Stable release available at <a href="http://urwid.org/">http://urwid.org</a></li> +{% else %} +<li><a href="https://pypi.python.org/packages/source/u/urwid/urwid-{{ release }}.tar.gz" +>Download: urwid-{{ release }}.tar.gz</a></li> +{% endif %} +<li><a href="changelog.html">Changelog</a> +</ul> + +<div class="hilight"><pre>git clone https://github.com/wardi/urwid.git</pre></div> + +<ul> +<li><a href="http://github.com/wardi/urwid">Github page</a></li> +<li><a href="http://github.com/wardi/urwid/issues">Issues</a></li> +<li><a href="http://webchat.oftc.net/?channels=%23urwid">IRC: <code>#urwid on irc.oftc.net</code></a></li> +<li><a href="http://lists.excess.org/mailman/listinfo/urwid">Mailing list</a> +(<a href="http://dir.gmane.org/gmane.comp.lib.urwid">gmane</a>)</li> +</ul> + +<p>Wiki:</p> + +<ul> +<li><a href="http://github.com/wardi/urwid/wiki/Installation-instructions">Installation instructions</a></li> +<li><a href="http://github.com/wardi/urwid/wiki/FAQ">FAQ</a></li> +<li><a href="http://github.com/wardi/urwid/wiki/Application-list">Applications built with Urwid</a></li> +<li><a href="http://github.com/wardi/urwid/wiki/How-you-can-help">How you can help</a></li> +<li><a href="http://github.com/wardi/urwid/wiki/Coding-style">Coding style</a></li> +<li><a href="http://github.com/wardi/urwid/wiki/Planned-development">Planned development</a></li> +</ul> + +<div class="section" id="requirements"> +<h3>Requirements</h3> +<ul> +<li>Python 2.6, 2.7, 3.2+ or PyPy</li> +<li>Linux, OSX, Cygwin or other unix-like OS</li> +<li>python-gi for GlibEventLoop (optional)</li> +<li>Twisted for TwistedEventLoop (optional)</li> +<li>Tornado for TornadoEventLoop (optional)</li> +<li>Apache for web_display module (optional)</li> +<li>ncurses for curses_display module (optional)</li> +</ul> +</div> + +<div class="section" id="similar"> +<h3>Similar projects</h3> +<ul> +<li><a href="http://www.npcole.com/npyscreen/">npyscreen</a></li> +</ul> </div> -<div class="section" id="manual" style="clear:both; padding-top: 8px"> -<h2><a class="reference internal" href="manual/index.html#urwid-manual"><em>Manual</em></a><a class="headerlink" href="#manual" title="Permalink to this headline">¶</a></h2> -<a class="reference external image-reference" href="manual/index.html#urwid-manual"><img alt="_images/introduction.png" src="_images/introduction.png" width="200" align="left" style="padding-right: 15px" /></a> -<p>The <a class="reference internal" href="manual/index.html#urwid-manual"><em>Urwid Manual</em></a> discusses each part of the library and how -everything fits together.</p> </div> -<div class="section" id="reference" style="clear:both; padding-top: 8px"> -<h2><a class="reference internal" href="reference/index.html#urwid-reference"><em>Reference</em></a><a class="headerlink" href="#reference" title="Permalink to this headline">¶</a></h2> -<a class="reference external image-reference" href="reference/index.html#urwid-reference"><img alt="_images/urwid_widgets_1.png" src="_images/urwid_widgets_1.png" width="200" align="left" style="padding-right: 15px" /></a> -<p>The <a class="reference internal" href="reference/index.html#urwid-reference"><em>Urwid Reference</em></a> documents all the classes and functions in the -library individually.</p> + +<div style="padding-left: 560px;"> +<div class="section" id="big-buttons"> +<p><a class="reference external image-reference" href="examples/index.html"><img alt="_images/graph2.png" src="_images/graph2.png" width="200" style="padding-bottom: 5px" /></br> +Examples</a></p> +<p><a class="reference external image-reference" href="tutorial/index.html"><img alt="_images/highcolors1.png" src="_images/highcolors1.png" width="200" style="padding-bottom: 5px" /></br> +Tutorial</a></p> +<p><a class="reference external image-reference" href="manual/index.html"><img alt="_images/introduction.png" src="_images/introduction.png" width="200" style="padding-bottom: 5px" /></br> +Manual</a></p> +<p><a class="reference external image-reference" href="reference/index.html"><img alt="_images/urwid_widgets_1.png" src="_images/urwid_widgets_1.png" width="200" style="padding-bottom: 5px" /></br> +Reference</a></p> +<p><a class="reference internal" href="genindex.html">Index</a></p> +<p><a class="reference internal" href="search.html">Search Page</a></p> </div> -<div class="section" id="indices-and-tables" style="clear: both; padding-top: 8px"> -<h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h2> -<ul class="simple"> -<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li> -<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li> </div> +<div style="clear:both"> </div> {% endblock %} diff --git a/docs/tools/templates/indexsidebar.html b/docs/tools/templates/indexsidebar.html index cdff25a..252d115 100644 --- a/docs/tools/templates/indexsidebar.html +++ b/docs/tools/templates/indexsidebar.html @@ -1,7 +1,8 @@ -<h3>Table of Contents</h4> +<h3>Documentation</h3> <div style="padding: 10px 0 16px 10px"> -<h4><a class="reference internal" href="tutorial/index.html#urwid-tutorial">Tutorial</a></h4> -<h4><a class="reference internal" href="manual/index.html#urwid-manual">Manual</a></h4> -<h4><a class="reference internal" href="reference/index.html#urwid-reference">Reference</a></h4> -<h4 style="padding-left: 8px"><a class="reference internal" href="genindex.html"><em>Index</em></a></h4> +<h4><a class="reference internal" href="examples/index.html">Examples</a></h4> +<h4><a class="reference internal" href="tutorial/index.html">Tutorial</a></h4> +<h4><a class="reference internal" href="manual/index.html">Manual</a></h4> +<h4><a class="reference internal" href="reference/index.html">Reference</a></h4> +<h4><a class="reference internal" href="genindex.html">Index</a></h4> </div> diff --git a/docs/tools/templates/layout.html b/docs/tools/templates/layout.html deleted file mode 100644 index bba7e42..0000000 --- a/docs/tools/templates/layout.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "!layout.html" %} -{% block rootrellink %} - <li><a href="http://excess.org/urwid/">Urwid Homepage</a> »</li> - {{ super() }} -{% endblock %} diff --git a/docs/tools/templates/localtoc.html b/docs/tools/templates/localtoc.html new file mode 100644 index 0000000..0e9bf8a --- /dev/null +++ b/docs/tools/templates/localtoc.html @@ -0,0 +1,18 @@ +{%- if pagename.startswith('manual/') -%} + <h3>Table of contents</a></h3> + <ul><li><a href="index.html">Manual</a></li> + {%- if display_toc -%} + {{ toc }} + {%- endif %} + </ul> +{%- elif pagename.startswith('reference/') -%} + <h3>Table of contents</a></h3> + <ul><li><a href="index.html">Reference</a></li> + {%- if display_toc -%} + {{ toc }} + {%- endif %} + </ul> +{%- elif display_toc -%} + <h3>Table of contents</a></h3> + {{ toc }} +{% endif %} diff --git a/docs/tutorial/lbscr.py b/docs/tutorial/lbscr.py deleted file mode 100644 index 9536549..0000000 --- a/docs/tutorial/lbscr.py +++ /dev/null @@ -1,30 +0,0 @@ -import urwid - -def show_all_input(keys, raw): - """make keys pressed visible to the user""" - show_key.set_text(u"Pressed: " + u" ".join([ - unicode(k) for k in keys])) - return keys - -def exit_on_cr(key): - if key == 'enter': - raise urwid.ExitMainLoop() - -palette = [('header', 'white', 'black'), - ('reveal focus', 'black', 'dark cyan', 'standout'),] - -div = urwid.Divider(u"-") -content = urwid.SimpleListWalker([ - urwid.AttrMap(w, None, 'reveal focus') for w in [ - urwid.Text(u"This is a text string that is fairly long"), - urwid.Divider(u"-"),] + [ - urwid.Text(u"Numbers %d" % i) for i in range(40)] + [ - urwid.Divider(u"-"), - urwid.Text(u"The end."),]]) -listbox = urwid.ListBox(content) -show_key = urwid.Text(u"", wrap='clip') -head = urwid.AttrMap(show_key, 'header') -top = urwid.Frame(listbox, head) -loop = urwid.MainLoop(top, palette, input_filter=show_all_input, - unhandled_input=exit_on_cr) -loop.run() diff --git a/docs/tutorial/lbscr.py.xdotool b/docs/tutorial/lbscr.py.xdotool deleted file mode 100644 index 9f733dd..0000000 --- a/docs/tutorial/lbscr.py.xdotool +++ /dev/null @@ -1,9 +0,0 @@ -windowsize --usehints $RXVTWINDOWID 15 7 -key --window $RXVTWINDOWID Down -key --window $RXVTWINDOWID Down -key --window $RXVTWINDOWID Down -key --window $RXVTWINDOWID Up -key --window $RXVTWINDOWID Down -windowsize --usehints $RXVTWINDOWID 20 9 -windowsize --usehints $RXVTWINDOWID 25 7 -windowsize --usehints $RXVTWINDOWID 11 13 diff --git a/docs/tutorial/lbscr1.png b/docs/tutorial/lbscr1.png Binary files differdeleted file mode 100644 index a938a66..0000000 --- a/docs/tutorial/lbscr1.png +++ /dev/null diff --git a/docs/tutorial/lbscr2.png b/docs/tutorial/lbscr2.png Binary files differdeleted file mode 100644 index 130032e..0000000 --- a/docs/tutorial/lbscr2.png +++ /dev/null diff --git a/docs/tutorial/lbscr3.png b/docs/tutorial/lbscr3.png Binary files differdeleted file mode 100644 index 8adf3d9..0000000 --- a/docs/tutorial/lbscr3.png +++ /dev/null diff --git a/docs/tutorial/lbscr4.png b/docs/tutorial/lbscr4.png Binary files differdeleted file mode 100644 index 81aa77d..0000000 --- a/docs/tutorial/lbscr4.png +++ /dev/null diff --git a/docs/tutorial/lbscr5.png b/docs/tutorial/lbscr5.png Binary files differdeleted file mode 100644 index 9861422..0000000 --- a/docs/tutorial/lbscr5.png +++ /dev/null diff --git a/docs/tutorial/lbscr6.png b/docs/tutorial/lbscr6.png Binary files differdeleted file mode 100644 index 81aa77d..0000000 --- a/docs/tutorial/lbscr6.png +++ /dev/null diff --git a/docs/tutorial/lbscr7.png b/docs/tutorial/lbscr7.png Binary files differdeleted file mode 100644 index 9ccac3d..0000000 --- a/docs/tutorial/lbscr7.png +++ /dev/null diff --git a/docs/tutorial/lbscr8.png b/docs/tutorial/lbscr8.png Binary files differdeleted file mode 100644 index 61e7752..0000000 --- a/docs/tutorial/lbscr8.png +++ /dev/null diff --git a/docs/tutorial/lbscr9.png b/docs/tutorial/lbscr9.png Binary files differdeleted file mode 100644 index 9a5f337..0000000 --- a/docs/tutorial/lbscr9.png +++ /dev/null diff --git a/docs/tutorial/urwid b/docs/tutorial/urwid deleted file mode 120000 index 2657fa1..0000000 --- a/docs/tutorial/urwid +++ /dev/null @@ -1 +0,0 @@ -../../urwid
\ No newline at end of file |