summaryrefslogtreecommitdiff
path: root/alot/ui.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-07-18 13:56:12 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-07-26 10:36:54 -0700
commitb722b246be0663415951cde486332b04a6ebeb38 (patch)
tree8546165ed6c5ad2ba1a32697d78f419a08e57483 /alot/ui.py
parentd5b96fd2d39aebce0f8ca22c37aa5a3830e1d643 (diff)
Drop all use of twisted!
This moves the actual event loop to be the default asyncio eventloop instead of the twisted reactor.
Diffstat (limited to 'alot/ui.py')
-rw-r--r--alot/ui.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/alot/ui.py b/alot/ui.py
index 48ea5b79..12a0d3f6 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -9,7 +9,6 @@ import contextlib
import asyncio
import traceback
-from twisted.internet import defer
import urwid
from .settings.const import settings
@@ -307,8 +306,7 @@ class UI(object):
def prompt(self, prefix, text=u'', completer=None, tab=0, history=None):
"""
prompt for text input.
- This returns a :class:`~twisted.defer.Deferred` that calls back with
- the input string.
+ This returns a :class:`asyncio.Future`, which will have a string value
:param prefix: text to print before the input field
:type prefix: str
@@ -321,7 +319,7 @@ class UI(object):
:type tab: int
:param history: history to be used for up/down keys
:type history: list of str
- :rtype: :class:`twisted.defer.Deferred`
+ :rtype: asyncio.Future
"""
history = history or []
@@ -369,7 +367,7 @@ class UI(object):
None)
self.mainloop.widget = overlay
self._passall = True
- return defer.Deferred.fromFuture(fut)
+ return fut
@staticmethod
def exit():
@@ -547,7 +545,7 @@ class UI(object):
:param msg_position: determines if `message` is above or left of the
prompt. Must be `above` or `left`.
:type msg_position: str
- :rtype: :class:`twisted.defer.Deferred`
+ :rtype: asyncio.Future
"""
choices = choices or {'y': 'yes', 'n': 'no'}
assert select is None or select in choices.values()
@@ -591,7 +589,7 @@ class UI(object):
None)
self.mainloop.widget = overlay
self._passall = True
- return defer.Deferred.fromFuture(fut)
+ return fut
def notify(self, message, priority='normal', timeout=0, block=False):
"""