Commit c883e47e authored by Ontje Lünsdorf's avatar Ontje Lünsdorf
Browse files

Use sphinx autodoc more extensively to reduce documentation fragmentation....

Use sphinx autodoc more extensively to reduce documentation fragmentation. Unfortunately, this adds some spurious "env = None" descriptions, but these should be fixed in sphinx 1.2
parent bdff073f
......@@ -20,96 +20,31 @@ Events
======
.. autoclass:: Event(env, value=PENDING, name=None)
.. attribute:: callbacks
List of functions that are called when the event is processed.
.. attribute:: env
The :class:`Environment` the event lives in.
.. attribute:: name
Optional name for this event. Used for :class:`str` / :func:`repr` if
not ``None``.
.. autoattribute:: triggered
.. autoattribute:: processed
.. autoattribute:: value
.. automethod:: succeed
.. automethod:: fail
:members:
.. autoclass:: Process
.. attribute:: callbacks
List of functions that are called when the event is processed.
.. attribute:: env
The :class:`Environment` the event lives in.
.. attribute:: name
Optional name for this event. Used for :class:`str` / :func:`repr` if
not ``None``.
.. autoattribute:: target
.. autoattribute:: is_alive
.. automethod:: interrupt
:members:
:show-inheritance:
.. autoclass:: Timeout
.. attribute:: callbacks
List of functions that are called when the event is processed.
.. attribute:: env
The :class:`Environment` the event lives in.
.. attribute:: name
Optional name for this event. Used for :class:`str` / :func:`repr` if
not ``None``.
:members:
:show-inheritance:
.. autoclass:: Condition
.. attribute:: callbacks
List of functions that are called when the event is processed.
.. attribute:: env
The :class:`Environment` the event lives in.
.. attribute:: name
Optional name for this event. Used for :class:`str` / :func:`repr` if
not ``None``.
.. automethod:: all_events
.. automethod:: any_events
:members:
:show-inheritance:
.. autoclass:: Initialize
.. attribute:: callbacks
List of functions that are called when the event is processed.
.. attribute:: env
The :class:`Environment` the event lives in.
:members:
:show-inheritance:
.. autoclass:: AllOf
:members:
:show-inheritance:
.. autoclass:: AnyOf
:members:
:show-inheritance:
Miscellaneous (Interrupt and constants)
=======================================
......
......@@ -101,11 +101,11 @@ class Event(object):
"""
def __init__(self, env, value=PENDING):
self.env = env
"""The :class:`Environment` the event lives in."""
self.callbacks = []
"""List of functions that are called when the event is
processed."""
self.env = env
"""The :class:`Environment` the event lives in."""
self._value = value
def __repr__(self):
......@@ -213,10 +213,9 @@ class Condition(Event):
The ``evaluate`` function receives the list of target events and the
dictionary with all values currently available. If it returns
``True``, the condition is scheduled. SimPy provides the
:func:`Condition.all_events()` and :func:`Condition.any_events()` functions
that are used for the implementation of *and* (``&``) and *or* (``|``) of
all SimPy event types.
``True``, the condition is scheduled. The :func:`Condition.all_events()`
and :func:`Condition.any_events()` functions are used to implement *and*
(``&``) and *or* (``|``) for events.
Since condition are normal events, too, they can also be used as
sub- or nested conditions.
......@@ -366,7 +365,7 @@ class Timeout(Event):
class Initialize(Event):
"""Initializes a process."""
"""Initializes a process. Only used internally by :class:`Process`."""
def __init__(self, env, process):
self.env = env
self.name = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment