Skip to content

Commit f1e522c

Browse files
committed
various doc improvements
1 parent 3b5074e commit f1e522c

4 files changed

Lines changed: 19 additions & 20 deletions

File tree

docs/source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
'sphinx.ext.viewcode',
3434
]
3535

36+
# RADIX CUSTOMIZATION
37+
autoclass_content = 'both'
38+
3639
# Add any paths that contain templates here, relative to this directory.
3740
templates_path = ['_templates']
3841

effect/__init__.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,37 @@
77
88
Here's a quick tour of the Effect library:
99
10-
- Intent: An object which specifies some action to perform, ideally with simple
11-
inert data in public attributes. For example, ReadLine(prompt='> ')
10+
- Intent: An object which describes a desired action, ideally with simple
11+
inert data in public attributes. For example, ``ReadLine(prompt='> ')`` could
12+
be an intent that describes the desire to read a line from the user after
13+
showing a prompt.
1214
- :obj:`Effect`: An object which binds callbacks to receive the result of
1315
performing an intent.
1416
- Performer: A callable that takes the Dispatcher, an Intent, and a Box. It
1517
executes the Intent and puts the result in the Box. For example, the
16-
performer for ReadLine() would read a line from STDIN.
18+
performer for ``ReadLine()`` could call ``raw_input(intent.prompt)``.
1719
- Dispatcher: A callable that takes an Intent and finds the Performer that can
1820
execute it (or None). See :obj:`TypeDispatcher` and :obj:`ComposedDispatcher`
1921
for handy pre-built dispatchers.
20-
- Box: An object that has 'succeed' and 'fail' methods for providing the result
21-
of an execution (potentially asynchronously). Usually you don't need to care
22-
about this, if you define your performers with :func:`effect.sync_performer`
23-
or :func:`effect.twisted.deferred_performer`.
22+
- Box: An object that has ``succeed`` and ``fail`` methods for providing the
23+
result of an execution (potentially asynchronously). Usually you don't need
24+
to care about this, if you define your performers with
25+
:func:`effect.sync_performer` or :func:`effect.twisted.deferred_performer`.
2426
2527
There's a few main things you need to do to use Effect.
2628
2729
- Define some intents to describe your side-effects (or use a library
2830
containing intents that already exist). For example, an ``HTTPRequest``
29-
intent that has 'method', 'url', etc attributes.
31+
intent that has ``method``, ``url``, etc attributes.
3032
- Write your application code to create effects like
3133
``Effect(HTTPRequest(...))`` and attach callbacks to them with
3234
:func:`Effect.on`.
3335
- As close as possible to the top-level of your application, perform your
3436
effect(s) with :func:`perform`.
3537
- You will need to pass a dispatcher to :func:`perform`. You should create one
36-
by using :class:`effect.dispatcher.ComposedDispatcher` to compose
37-
:obj:`effect.base_dispatcher` (which performers for built-in effects) and a
38-
:class:`effect.dispatcher.TypeDispatcher` with your own performers (e.g. for
39-
``HTTPRequest``).
38+
by creating a :class:`TypeDispatcher` with your own performers (e.g. for
39+
``HTTPRequest``), and composing it with :obj:`effect.base_dispatcher` (which
40+
has performers for built-in effects) using :class:`ComposedDispatcher`.
4041
"""
4142

4243
from __future__ import absolute_import
@@ -49,6 +50,7 @@
4950
base_dispatcher)
5051
from ._dispatcher import ComposedDispatcher, TypeDispatcher
5152

53+
5254
__all__ = [
5355
"Effect", "perform", "NoPerformerFoundError",
5456
"NotSynchronousError", "sync_perform", "sync_performer",

effect/_base.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,10 @@ class Effect(object):
1919
allow binding callbacks to be called with the result of the effect.
2020
2121
Effects can be performed with :func:`perform`.
22-
23-
(You're an object-oriented programmer.
24-
You probably want to subclass this.
25-
Don't.)
2622
"""
2723
def __init__(self, intent, callbacks=None):
2824
"""
29-
:param intent: An object that describes an effect to be
30-
performed.
25+
:param intent: An object that describes an effect to be performed.
3126
"""
3227
self.intent = intent
3328
if callbacks is None:

effect/_dispatcher.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ class TypeDispatcher(object):
1313
"""
1414
def __init__(self, mapping):
1515
"""
16-
:param collections.Mapping mapping: A mapping of intent type to
17-
performer.
16+
:param collections.Mapping mapping: mapping of intent type to performer
1817
"""
1918
self.mapping = mapping
2019

0 commit comments

Comments
 (0)