summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2012-03-28 22:36:07 -0400
committerIan Ward <ian@excess.org>2012-03-28 22:36:07 -0400
commit31c277270ecb17cc307cf6e489dd2f5fbee89dd8 (patch)
treebc24295b0d7bd606b6ae1e68f282fd05b78b8ed2
parent6bed9d925ad75d81b7867806c738c9c02298cccc (diff)
downloadurwid-31c277270ecb17cc307cf6e489dd2f5fbee89dd8.tar.gz
main_loop: move all reference docs into docstrings
--HG-- branch : feature-sphinx
-rw-r--r--docs/conf.py6
-rwxr-xr-xdocs/reference/main_loop.rst22
-rwxr-xr-xurwid/main_loop.py30
3 files changed, 34 insertions, 24 deletions
diff --git a/docs/conf.py b/docs/conf.py
index eeb1b0c..5abd3e9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -283,3 +283,9 @@ epub_copyright = u'2011, Ian Ward'
# Allow duplicate toc entries.
#epub_tocdup = True
+
+#autoclass_content = "both"
+
+autodoc_member_order = "bysource"
+
+autodoc_default_flags = ["members", "show-inheritance"]
diff --git a/docs/reference/main_loop.rst b/docs/reference/main_loop.rst
index e99105e..73695c7 100755
--- a/docs/reference/main_loop.rst
+++ b/docs/reference/main_loop.rst
@@ -1,27 +1,19 @@
-Main Loop and Event Loop Reference
-==================================
+Main Loop and Event Loop Classes
+================================
+
+Main Loop
+---------
.. autoexception:: urwid.ExitMainLoop
.. autoclass:: urwid.MainLoop
- :members: set_alarm_in, set_alarm_at, remove_alarm,
- watch_pipe, remove_watch_pipe,
- run, process_input, input_filter, unhandled_input,
- entering_idle, draw_screen,
-
- .. attribute:: widget
- Property for the topmost widget used. This must be a box widget.
+Event Loops
+-----------
.. autoclass:: urwid.SelectEventLoop
- :members: alarm, remove_alarm, watch_file, remove_watch_file,
- enter_idle, remove_enter_idle, run
.. autoclass:: urwid.GLibEventLoop
- :members: alarm, remove_alarm, watch_file, remove_watch_file,
- enter_idle, remove_enter_idle, run, handle_exit
.. autoclass:: urwid.TwistedEventLoop
- :members: alarm, remove_alarm, watch_file, remove_watch_file,
- enter_idle, remove_enter_idle, run, handle_exit
diff --git a/urwid/main_loop.py b/urwid/main_loop.py
index d5e7b05..15d7f6e 100755
--- a/urwid/main_loop.py
+++ b/urwid/main_loop.py
@@ -49,28 +49,39 @@ class MainLoop(object):
This is the standard main loop implementation with a single screen.
*widget* -- the topmost widget used for painting the screen, stored as
- self.widget and may be modified. Must be a box widget.
+ :attr:`.widget` and may be modified. Must be a box widget.
*palette* -- initial palette for screen.
- *screen* -- screen object or ``None`` to use a new raw_display.Screen
- instance. stored as self.screen
+ *screen* -- screen object or ``None`` to use a new
+ :class:`urwid.raw_display.Screen` instance. stored as :attr:`.screen`
*handle_mouse* -- ``True`` to process mouse events, passed to
- ``self.screen``
+ :attr:`.screen`
*input_filter* -- a function to filter input before sending it to
- ``self.widget``, called from ``self.input_filter``
+ :attr:`.widget`, called from :meth:`.input_filter`
*unhandled_input* -- a function called when input is not handled by
- ``self.widget``, called from ``self.unhandled_input``
+ :attr:`.widget`, called from :meth:`.unhandled_input`
*event_loop* -- if screen supports external an event loop it may be
given here, or leave as None to use a new
- *SelectEventLoop* instance; stored as ``self.event_loop``
+ *SelectEventLoop* instance; stored as :attr:`.event_loop`
- *pop_ups* -- ``True`` to wrap ``self.widget`` with a ``PopUpTarget``
+ *pop_ups* -- ``True`` to wrap :attr:`.widget` with a :class:`PopUpTarget`
instance to allow any widget to open a pop-up anywhere on the screen
+
+
+ .. attribute:: screen
+
+ The screen object this main loop uses for screen updates and reading
+ input
+
+ .. attribute:: event_loop
+
+ The event loop object this main loop uses for waiting on timers
+ and IO
"""
def __init__(self, widget, palette=[], screen=None,
handle_mouse=True, input_filter=None, unhandled_input=None,
@@ -109,7 +120,8 @@ class MainLoop(object):
self._topmost_widget.original_widget = self._widget
else:
self._topmost_widget = self._widget
- widget = property(lambda self:self._widget, _set_widget)
+ widget = property(lambda self:self._widget, _set_widget, doc=
+ "Property for the topmost widget used. This must be a box widget.")
def _set_pop_ups(self, pop_ups):
self._pop_ups = pop_ups