Skip to content

Commit

Permalink
Merge pull request #1320 from dcbaker/fix-async-idle
Browse files Browse the repository at this point in the history
Fix async idle
  • Loading branch information
dcbaker committed Oct 4, 2018
2 parents 41197b7 + 40bff82 commit 4a67118
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
3 changes: 3 additions & 0 deletions alot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
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']
Expand Down
6 changes: 3 additions & 3 deletions alot/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, dbman, initialcmdline):
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)

Expand Down Expand Up @@ -310,7 +310,7 @@ def prompt(self, prefix, text=u'', completer=None, tab=0, history=None):
"""
history = history or []

fut = asyncio.Future()
fut = asyncio.get_event_loop().create_future()
oldroot = self.mainloop.widget

def select_or_cancel(text):
Expand Down Expand Up @@ -539,7 +539,7 @@ def choice(self, message, choices=None, select=None, cancel=None,
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):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'notmuch>=0.26',
'urwid>=1.3.0',
'urwidtrees>=1.0',
'twisted>=10.2.0',
'python-magic',
'configobj>=4.7.0',
'gpg'
Expand Down

0 comments on commit 4a67118

Please sign in to comment.