diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-10-04 13:04:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-04 13:04:47 -0700 |
commit | 4a6711865b154152d4978e8316727f4902de3e02 (patch) | |
tree | 916a2fc21dae41da78834137dd1d3a4d46df6f90 | |
parent | 41197b766f5223c1d3f02594c9324b67c14c56ae (diff) | |
parent | 40bff8280124c9aea189480a1a8b98d62a5d9fb3 (diff) |
Merge pull request #1320 from dcbaker/fix-async-idle
Fix async idle
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | alot/__main__.py | 3 | ||||
-rw-r--r-- | alot/ui.py | 6 | ||||
-rwxr-xr-x | setup.py | 1 |
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. @@ -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'] @@ -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): @@ -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' |