diff options
Diffstat (limited to 'docs/source/api')
-rw-r--r-- | docs/source/api/conf.py | 4 | ||||
-rw-r--r-- | docs/source/api/interface.rst | 17 |
2 files changed, 4 insertions, 17 deletions
diff --git a/docs/source/api/conf.py b/docs/source/api/conf.py index d43f2404..6277eb4e 100644 --- a/docs/source/api/conf.py +++ b/docs/source/api/conf.py @@ -30,10 +30,6 @@ class Mock(object): return Mock() if name not in ('__file__', '__path__') else '/dev/null' MOCK_MODULES = ['notmuch', 'notmuch.globals', - 'twisted', 'twisted.internet', - 'twisted.internet.defer', - 'twisted.python', - 'twisted.python.failure', 'urwid', 'magic', 'argparse'] diff --git a/docs/source/api/interface.rst b/docs/source/api/interface.rst index 7babae93..50e8baec 100644 --- a/docs/source/api/interface.rst +++ b/docs/source/api/interface.rst @@ -15,22 +15,13 @@ key presses to the wrapped root widget and thereby accessing standard urwid behaviour. In order to keep the interface non-blocking and react to events like -terminal size changes, alot makes use of twisted's deferred_ - a -framework that makes it easy to deal with callbacks. Many commands in alot make use of -`inline callbacks`_, which allow you to treat deferred-returning functions almost like -syncronous functions. Consider the following example of a function that prompts for some -input and acts on it: - -.. _deferred: http://twistedmatrix.com/documents/current/core/howto/defer.html -.. _`inline callbacks`: http://twistedmatrix.com/documents/8.1.0/api/twisted.internet.defer.html#inlineCallbacks +terminal size changes, alot makes use of asyncio - which allows asynchronous calls +without the use of callbacks. Alot makes use of the python 3.5 async/await syntax .. code-block:: python - from twisted.internet import defer - - @defer.inlineCallbacks - def greet(ui): # ui is instance of alot.ui.UI - name = yield ui.prompt('pls enter your name') + async def greet(ui): # ui is instance of alot.ui.UI + name = await ui.prompt('pls enter your name') ui.notify('your name is: ' + name) |