From 44ca6baf3cfe43abc23e7b6a317b40b92c60e06d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 18 Jul 2018 14:07:11 -0700 Subject: docs: Remove references to twisted Except for an FAQ entry about it. --- docs/source/api/conf.py | 4 ---- docs/source/api/interface.rst | 17 ++++------------- docs/source/conf.py | 7 +------ docs/source/faq.rst | 8 ++++++++ docs/source/installation.rst | 5 ++--- 5 files changed, 15 insertions(+), 26 deletions(-) (limited to 'docs') 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) diff --git a/docs/source/conf.py b/docs/source/conf.py index 19b0d183..d86ae419 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,12 +23,7 @@ class MockModule(object): def __getattr__(cls, name): return Mock if name not in ('__file__', '__path__') else '/dev/null' -MOCK_MODULES = ['twisted', 'twisted.internet', - 'twisted.internet.defer', - 'twisted.python', - 'twisted.python.failure', - 'twisted.internet.protocol', - 'urwid', +MOCK_MODULES = ['urwid', 'urwidtrees', 'magic', 'gpg', diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 9ad30a8b..17833a05 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -73,3 +73,11 @@ FAQ Python 2 support. If you still need Python 2 support the 0.7 release is your best bet. +.. _faq_8: + +8. I thought alot used twisted? + + It used to. After we switched to python 3 we decided to switch to asyncio, + which reduced the number of dependencies we have. Twisted is an especially + heavy dependency, when we only used their async mechanisms, and not any of + the other goodness that twisted has to offer. diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 2d3fe44c..f5184f47 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -9,7 +9,6 @@ A full list of dependencies is below: * `libmagic and python bindings `_, ≥ `5.04` * `configobj `_, ≥ `4.7.0` -* `twisted `_, ≥ `10.2.0`: * `libnotmuch `_ and it's python bindings, ≥ `0.13` * `urwid `_ toolkit, ≥ `1.3.0` * `urwidtrees `_, ≥ `1.0` @@ -26,11 +25,11 @@ A full list of dependencies is below: On debian/ubuntu the rest are packaged as:: - python-setuptools python-magic python-configobj python-twisted python-notmuch python-urwid python-gpg + python-setuptools python-magic python-configobj python-notmuch python-urwid python-gpg On fedora/redhat these are packaged as:: - python-setuptools python-magic python-configobj python-twisted python-notmuch python-urwid python-gpg + python-setuptools python-magic python-configobj python-notmuch python-urwid python-gpg Alot uses `mailcap `_ to look up mime-handler for inline rendering and opening of attachments. For a full description of the maicap protocol consider the -- cgit v1.2.3