summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-10-04 13:04:47 -0700
committerGitHub <noreply@github.com>2018-10-04 13:04:47 -0700
commit4a6711865b154152d4978e8316727f4902de3e02 (patch)
tree916a2fc21dae41da78834137dd1d3a4d46df6f90
parent41197b766f5223c1d3f02594c9324b67c14c56ae (diff)
parent40bff8280124c9aea189480a1a8b98d62a5d9fb3 (diff)
Merge pull request #1320 from dcbaker/fix-async-idle
Fix async idle
-rw-r--r--.travis.yml2
-rw-r--r--NEWS1
-rw-r--r--alot/__main__.py3
-rw-r--r--alot/ui.py6
-rwxr-xr-xsetup.py1
5 files changed, 8 insertions, 5 deletions
diff --git a/.travis.yml b/.travis.yml
index 4af4f86b..e23441ab 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -119,7 +119,7 @@ install:
- |
set -e
if [[ $JOB = docs ]]; then
- pip install configobj python-magic urwidtrees
+ pip install configobj twisted python-magic urwidtrees
# Mock all "difficult" dependencies of alot in order to be able to import
# alot when rebuilding the documentation. Notmuch would have to be
# installed by hand in order to get a recent enough version on travis.
diff --git a/NEWS b/NEWS
index 6ac982e8..b10fff28 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,6 @@
0.8:
* Port to python 3. Python 2.x no longer supported
* feature: Add a new 'namedqueries' buffer type for displaying named queries.
-* feature: Replace twisted with asyncio
* bug fix: correct handling of subparts with different encodings
0.7:
diff --git a/alot/__main__.py b/alot/__main__.py
index 221e6b22..c901bb07 100644
--- a/alot/__main__.py
+++ b/alot/__main__.py
@@ -16,6 +16,9 @@ from alot.commands import *
from alot.commands import CommandParseError, COMMANDS
from alot.utils import argparse as cargparse
+from twisted.internet import asyncioreactor
+asyncioreactor.install()
+
_SUBCOMMANDS = ['search', 'compose', 'bufferlist', 'taglist', 'namedqueries',
'pyshell']
diff --git a/alot/ui.py b/alot/ui.py
index 457fd078..b528518f 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -115,7 +115,7 @@ class UI(object):
self.mainloop = urwid.MainLoop(
self.root_widget,
handle_mouse=settings.get('handle_mouse'),
- event_loop=urwid.AsyncioEventLoop(),
+ event_loop=urwid.TwistedEventLoop(),
unhandled_input=self._unhandled_input,
input_filter=self._input_filter)
@@ -310,7 +310,7 @@ class UI(object):
"""
history = history or []
- fut = asyncio.Future()
+ fut = asyncio.get_event_loop().create_future()
oldroot = self.mainloop.widget
def select_or_cancel(text):
@@ -539,7 +539,7 @@ class UI(object):
assert cancel is None or cancel in choices.values()
assert msg_position in ['left', 'above']
- fut = asyncio.Future() # Create a returned future
+ fut = asyncio.get_event_loop().create_future() # Create a returned future
oldroot = self.mainloop.widget
def select_or_cancel(text):
diff --git a/setup.py b/setup.py
index 9c85a663..6c322404 100755
--- a/setup.py
+++ b/setup.py
@@ -48,6 +48,7 @@ setup(
'notmuch>=0.26',
'urwid>=1.3.0',
'urwidtrees>=1.0',
+ 'twisted>=10.2.0',
'python-magic',
'configobj>=4.7.0',
'gpg'