diff options
| author | Ian Ward <ian@excess.org> | 2012-07-14 16:37:47 -0400 |
|---|---|---|
| committer | Ian Ward <ian@excess.org> | 2012-07-14 16:37:47 -0400 |
| commit | af09836a8813ea878ac9dbd5ce351f7bead5cbe1 (patch) | |
| tree | 7d1ee48046b508e8b5b8e8a3b4a9e8ed12e6a88a /docs/reference | |
| parent | f2985b2e70e1b654541495a1576878af56297a7a (diff) | |
| download | urwid-af09836a8813ea878ac9dbd5ce351f7bead5cbe1.tar.gz | |
clean up use of urwid. prefix in docs
--HG--
branch : feature-sphinx
Diffstat (limited to 'docs/reference')
| -rw-r--r-- | docs/reference/basic.rst | 140 | ||||
| -rw-r--r-- | docs/reference/constants.rst | 96 | ||||
| -rw-r--r-- | docs/reference/containers.rst | 2 | ||||
| -rw-r--r-- | docs/reference/decorations.rst | 2 | ||||
| -rw-r--r-- | docs/reference/exceptions.rst | 6 | ||||
| -rw-r--r-- | docs/reference/index.rst | 1 | ||||
| -rw-r--r-- | docs/reference/main_loop.rst | 2 | ||||
| -rw-r--r-- | docs/reference/widget.rst | 8 |
8 files changed, 66 insertions, 191 deletions
diff --git a/docs/reference/basic.rst b/docs/reference/basic.rst index d4719c7..8a2230c 100644 --- a/docs/reference/basic.rst +++ b/docs/reference/basic.rst @@ -1,143 +1,9 @@ Basic Widgets ============= -.. class:: Divider([div_char=u" ", top=0, bottom=0]) +.. currentmodule:: urwid - Horizontal divider widget - - Create a horizontal divider widget. - - *div_char* -- character to repeat across line - - *top* -- number of blank lines above - - *bottom* -- number of blank lines below - - ignore_focus = True - - -.. class:: SolidFill([fill_char=" "]) - - Create a box widget that will fill an area with a single character. - - *fill_char* -- character to fill area with - - -.. exception:: TextError - - todo - - -.. class:: Text(self, markup[, align=LEFT, wrap=SPACE, layout=None]) - - A horizontally resizeable text widget. - - *markup* -- content of text widget, one of: - - * plain string -- string is displayed - - * ``(attr, markup2)`` -- markup2 is given attribute attr - - * ``[markupA, markupB, ...]`` -- list items joined together - - *align* -- align mode for text layout - - *wrap* -- wrap mode for text layout - - *layout* -- layout object to use, defaults to StandardTextLayout - - .. method:: def set_text(markup) - - Set content of text widget. - - .. method:: get_text() - - Returns ``(text, attributes)``. - - *text* -- complete string content (unicode) of text widget - - *attributes* -- run length encoded attributes for text - - .. attribute:: text - - .. attribute:: attrib - - .. method:: set_align_mode(mode) - - Set text alignment/justification. Valid modes for StandardTextLayout are: - ``'left'``, ``'center'`` and ``'right'``. - - .. method:: set_wrap_mode(mode) - - Set wrap mode. - - .. method:: set_layout(align, wrap[, layout=None]) - - Set layout object, align and wrap modes: - - *align* -- align mode for text layout - - *wrap* -- wrap mode for text layout - - *layout* -- layout object to use, defaults to StandardTextLayout - - .. attribute:: align - - .. attribute:: wrap - - .. attribute:: layout - - .. method:: get_line_translation(maxcol[, ta=None]) - - Return layout structure used to map self.text to a canvas. This method - is used internally, but may be useful for debugging custom layout - classes. - - -.. exception:: EditError - - todo - - -.. class:: Edit([caption=u"", edit_text=u"", multiline=False, align=LEFT, \ - wrap=SPACE, allow_tab=False, edit_pos=None, layout=None, \ - mask=None]) - - Text editing widget implements cursor movement, text insertion and deletion. - A caption may prefix the editing area. Uses text class for text layout. - - *caption* -- markup for caption preceeding edit_text - - *edit_text* -- text string for editing - - *multiline* -- True: 'enter' inserts newline False: return it - - *align* -- align mode - - *wrap* -- wrap mode - - *allow_tab* -- True: 'tab' inserts 1-8 spaces False: return it - - *edit_pos* -- initial position for cursor, None:at end - - *layout* -- layout object - - *mask* -- character to mask away text with, None means no masking - - signals = ["change"] - - .. method:: valid_char(ch) - - Return true for printable characters. - - .. method:: update_text() - - No longer supported. - - .. method:: set_caption(caption) - - Set the caption markup for this widget. - - *caption* -- see ``Text.__init__()`` for description of markup +.. autoclass:: Text +.. autoclass:: Edit diff --git a/docs/reference/constants.rst b/docs/reference/constants.rst index 3ef7c6b..8259731 100644 --- a/docs/reference/constants.rst +++ b/docs/reference/constants.rst @@ -1,6 +1,8 @@ Constants ========= +.. currentmodule:: urwid + .. note:: These constants may be used, but using the string values themselves in @@ -14,21 +16,21 @@ Widget Sizing Methods One or more of these values returned by :meth:`Widget.sizing` to indicate supported sizing methods. -.. data:: urwid.FLOW +.. data:: FLOW :annotation: = 'flow' Widget that is given a number of columns by its parent widget and calculates the number of rows it requires for rendering e.g. :class:`Text` -.. data:: urwid.BOX +.. data:: BOX :annotation: = 'box' Widget that is given a number of columns and rows by its parent widget and must render that size e.g. :class:`ListBox` -.. data:: urwid.FIXED +.. data:: FIXED :annotation: = 'fixed' Widget that knows the number of columns and rows it requires and will @@ -42,13 +44,13 @@ Horizontal Alignment Used to horizontally align text in :class:`Text` widgets and child widgets of :class:`Padding` and :class:`Overlay`. -.. data:: urwid.LEFT +.. data:: LEFT :annotation: = 'left' -.. data:: urwid.CENTER +.. data:: CENTER :annotation: = 'center' -.. data:: urwid.RIGHT +.. data:: RIGHT :annotation: = 'right' Veritcal Alignment @@ -57,13 +59,13 @@ Veritcal Alignment Used to vertically align child widgets of :class:`Filler` and :class:`Overlay`. -.. data:: urwid.TOP +.. data:: TOP :annotation: = 'top' -.. data:: urwid.MIDDLE +.. data:: MIDDLE :annotation: = 'middle' -.. data:: urwid.BOTTOM +.. data:: BOTTOM :annotation: = 'bottom' Width and Height Settings @@ -73,27 +75,27 @@ Used to distribute or set widths and heights of child widgets of :class:`Padding`, :class:`Filler`, :class:`Columns`, :class:`Pile` and :class:`Overlay`. -.. data:: urwid.PACK +.. data:: PACK :annotation: = 'pack' Ask the child widget to calculate the number of columns or rows it needs -.. data:: urwid.GIVEN +.. data:: GIVEN :annotation: = 'given' A set number of columns or rows, e.g. ('given', 10) will have exactly 10 columns or rows given to the child widget -.. data:: urwid.RELATIVE +.. data:: RELATIVE :annotation: = 'relative' A percentage of the total space, e.g. ('relative', 50) will give half of the total columns or rows to the child widget -.. data:: urwid.RELATIVE_100 +.. data:: RELATIVE_100 :annotation: = ('relative', 100) -.. data:: urwid.WEIGHT +.. data:: WEIGHT :annotation: = 'weight' A weight value for distributing columns or rows, e.g. ('weight', 3) @@ -104,18 +106,18 @@ Used to distribute or set widths and heights of child widgets of Text Wrapping Modes ------------------- -.. data:: urwid.SPACE +.. data:: SPACE :annotation: = 'space' wrap text on space characters or at the boundaries of wide characters -.. data:: urwid.ANY +.. data:: ANY :annotation: = 'any' wrap before any wide or narrow character that would exceed the available screen columns -.. data:: urwid.CLIP +.. data:: CLIP :annotation: = 'clip' clip before any wide or narrow character that would exceed the available @@ -128,55 +130,55 @@ Foreground and Background Colors Standard background and foreground colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. data:: urwid.BLACK +.. data:: BLACK :annotation: = 'black' -.. data:: urwid.DARK_RED +.. data:: DARK_RED :annotation: = 'dark red' -.. data:: urwid.DARK_GREEN +.. data:: DARK_GREEN :annotation: = 'dark green' -.. data:: urwid.BROWN +.. data:: BROWN :annotation: = 'brown' -.. data:: urwid.DARK_BLUE +.. data:: DARK_BLUE :annotation: = 'dark blue' -.. data:: urwid.DARK_MAGENTA +.. data:: DARK_MAGENTA :annotation: = 'dark magenta' -.. data:: urwid.DARK_CYAN +.. data:: DARK_CYAN :annotation: = 'dark cyan' -.. data:: urwid.LIGHT_GRAY +.. data:: LIGHT_GRAY :annotation: = 'light gray' Standard foreground colors (not safe to use as background) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. data:: urwid.DARK_GRAY +.. data:: DARK_GRAY :annotation: = 'dark gray' -.. data:: urwid.LIGHT_RED +.. data:: LIGHT_RED :annotation: = 'light red' -.. data:: urwid.LIGHT_GREEN +.. data:: LIGHT_GREEN :annotation: = 'light green' -.. data:: urwid.YELLOW +.. data:: YELLOW :annotation: = 'yellow' -.. data:: urwid.LIGHT_BLUE +.. data:: LIGHT_BLUE :annotation: = 'light blue' -.. data:: urwid.LIGHT_MAGENTA +.. data:: LIGHT_MAGENTA :annotation: = 'light magenta' -.. data:: urwid.LIGHT_CYAN +.. data:: LIGHT_CYAN :annotation: = 'light cyan' -.. data:: urwid.WHITE +.. data:: WHITE :annotation: = 'white' User's terminal configuration default foreground or background @@ -189,7 +191,7 @@ User's terminal configuration default foreground or background it is highly recommended to use this setting for both foreground and background when you do use it. -.. data:: urwid.DEFAULT +.. data:: DEFAULT :annotation: = 'default' @@ -207,7 +209,7 @@ Constants are not defined for these colors. Signal Names ------------ -.. data:: urwid.UPDATE_PALETTE_ENTRY +.. data:: UPDATE_PALETTE_ENTRY :annotation: = 'update palette entry' sent by :class:`BaseScreen` (and subclasses like @@ -215,12 +217,12 @@ Signal Names :class:`MainLoop` handles this signal by redrawing the whole screen. -.. data:: urwid.INPUT_DESCRIPTORS_CHANGED +.. data:: INPUT_DESCRIPTORS_CHANGED :annotation: = 'input descriptors changed' sent by :class:`BaseScreen` (and subclasses like :class:`raw_display.Screen`) when the list of input file descriptors - has changed. :class:`urwid.MainLoop` handles this signal by updating + has changed. :class:`MainLoop` handles this signal by updating the file descriptors being watched by its event loop. @@ -235,7 +237,7 @@ You may define any new command names as you wish and look for them in your own widget code. These are the standard ones expected by code included in Urwid. -.. data:: urwid.REDRAW_SCREEN +.. data:: REDRAW_SCREEN :annotation: = 'redraw screen' Default associated keypress: 'ctrl l' @@ -244,7 +246,7 @@ included in Urwid. a screen refresh. This is useful in case the screen becomes corrupted. -.. data:: urwid.ACTIVATE +.. data:: ACTIVATE :annotation: = 'activate' Default associated keypresses: ' ' (space), 'enter' @@ -252,56 +254,56 @@ included in Urwid. Activate a widget such as a :class:`Button`, :class:`CheckBox` or :class:`RadioButton`. -.. data:: urwid.CURSOR_UP +.. data:: CURSOR_UP :annotation: = 'cursor up' Default associated keypress: 'up' Move the cursor or selection up one row. -.. data:: urwid.CURSOR_DOWN +.. data:: CURSOR_DOWN :annotation: = 'cursor down' Default associated keypress: 'down' Move the cursor or selection down one row. -.. data:: urwid.CURSOR_LEFT +.. data:: CURSOR_LEFT :annotation: = 'cursor left' Default associated keypress: 'left' Move the cursor or selection left one column. -.. data:: urwid.CURSOR_RIGHT +.. data:: CURSOR_RIGHT :annotation: = 'cursor right' Default associated keypress: 'right' Move the cursor or selection right one column. -.. data:: urwid.CURSOR_PAGE_UP +.. data:: CURSOR_PAGE_UP :annotation: = 'cursor page up' Default associated keypress: 'page up' Move the cursor or selection up one page. -.. data:: urwid.CURSOR_PAGE_DOWN +.. data:: CURSOR_PAGE_DOWN :annotation: = 'cursor page down' Default associated keypress: 'page down' Move the cursor or selection down one page. -.. data:: urwid.CURSOR_MAX_LEFT +.. data:: CURSOR_MAX_LEFT :annotation: = 'cursor max left' Default associated keypress: 'home' Move the cursor or selection to the leftmost column. -.. data:: urwid.CURSOR_MAX_RIGHT +.. data:: CURSOR_MAX_RIGHT :annotation: = 'cursor max right' Default associated keypress: 'end' diff --git a/docs/reference/containers.rst b/docs/reference/containers.rst index 2557111..26c76dd 100644 --- a/docs/reference/containers.rst +++ b/docs/reference/containers.rst @@ -1,7 +1,7 @@ Containers =========== -.. module:: urwid +.. currentmodule:: urwid .. autoclass:: Frame diff --git a/docs/reference/decorations.rst b/docs/reference/decorations.rst index afbdf41..37d7b4e 100644 --- a/docs/reference/decorations.rst +++ b/docs/reference/decorations.rst @@ -1,7 +1,7 @@ Decorations =========== -.. module:: urwid +.. currentmodule:: urwid .. autoclass:: AttrMap diff --git a/docs/reference/exceptions.rst b/docs/reference/exceptions.rst index c26801e..051184e 100644 --- a/docs/reference/exceptions.rst +++ b/docs/reference/exceptions.rst @@ -1,7 +1,7 @@ Exceptions ========== -.. module:: urwid +.. currentmodule:: urwid .. autoexception:: ExitMainLoop @@ -18,3 +18,7 @@ Exceptions .. autoexception:: BoxAdapterError .. autoexception:: OverlayError + +.. autoexception:: TextError + +.. autoexception:: EditError diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 064f9cd..381511f 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -6,6 +6,7 @@ Urwid Reference main_loop widget + basic decorations containers constants diff --git a/docs/reference/main_loop.rst b/docs/reference/main_loop.rst index 78fc0b3..c9519f9 100644 --- a/docs/reference/main_loop.rst +++ b/docs/reference/main_loop.rst @@ -1,7 +1,7 @@ Main Loops and Event Loops ========================== -.. module:: urwid +.. currentmodule:: urwid .. autoclass:: MainLoop diff --git a/docs/reference/widget.rst b/docs/reference/widget.rst index 4de6bf5..d97a162 100644 --- a/docs/reference/widget.rst +++ b/docs/reference/widget.rst @@ -1,6 +1,8 @@ Widget Base Class ================= -.. autoclass:: urwid.Widget - -.. autoclass:: urwid.WidgetMeta +.. currentmodule:: urwid + +.. autoclass:: Widget + +.. autoclass:: WidgetMeta |
