summaryrefslogtreecommitdiff
path: root/alot/ui.py
Commit message (Collapse)AuthorAge
* UI: drop always-true function argumentAnton Khirnov2022-05-11
|
* commands/globals:BufferCloseCommand: drop unused redraw paramAnton Khirnov2022-05-11
| | | | | Drop it also from the corresponding UI functions, where it does not do anything.
* ui: move _{save,load}_history* out of the UI classAnton Khirnov2022-05-11
| | | | | They are currently private staticmethods and there is no good reason to keep them inside UI, they only make the already large class larger.
* ui: change command hooks back to normal callablesAnton Khirnov2021-12-03
| | | | | | | They are treated as coroutines now, but this does not seem to be documented. This is a step towards making commands synhronous again.
* Rewrite mailcap handling.Anton Khirnov2021-01-26
| | | | | | | | | | | Add a class that encapsulates the handler and is responsible for managing the temporary file, if one is needed. Use this class for both rendering inline content and displaying attachments externally. External attachments are now wrapped in an asyncio task that is added to a pool of tasks managed by ui.
* buffers: make get_info() asynchronousAnton Khirnov2021-01-20
| | | | | Allows computing message/thread counts asynchronously in a separate thread.
* ui: clean up asyncio callsAnton Khirnov2021-01-20
| | | | Bump python dependency to 3.7, which added create_task().
* db: make write operations asyncAnton Khirnov2021-01-20
|
* ui: do not display an error on cancelling a commandAnton Khirnov2021-01-16
| | | | This is not an error state, just normal operation.
* buffers/thread: more sophisticated heuristics for default weightsAnton Khirnov2021-01-09
| | | | Should produce better results in most situations.
* ui: remove forgotten development logAnton Khirnov2020-04-25
|
* ui: rewrite notification/status bar handlingAnton Khirnov2020-04-23
| | | | | | | | | Do not recreate all the widgets on every update, just update the widget contents. Make the statusbar update async, since some calls to get_info() can take a long time (especially noticeable for counting threads for searches with many results).
* thread buffer: make attachments work againAnton Khirnov2020-02-25
|
* alot: drop the total_messages info propertyAnton Khirnov2020-02-03
| | | | It is an utterly useless number.
* Remove unicode literals syntax from python2Lucas Hoffmann2019-11-06
|
* unused imports and variablesPatrick Totzke2019-08-15
|
* remove old new-style classes syntaxPatrick Totzke2019-05-27
| | | | | | Python3 only supports "new-style" classes (those extending object), and we don't need to explicitly inherit from this root class any more. See http://pylint-messages.wikidot.com/messages:c1001
* fix double-line issuePatrick Totzke2019-03-04
| | | | | | | | | Tagstrings with double-width characters resulted in not enough horizontal space being allocated, which lead urwid to draw the statusline in two lines instead of one (see #742). This lets urwid calculate the necessary width itself, using its pack() method.
* Go back to Twisted event loopDylan Baker2018-10-04
| | | | | | | | | | Urwid + asyncio has been known to have very high CPU usage for 4 years now, and it hasn't been fixed. That basically makes it impossible to switch event loops. We can still get the asyncio syntax goodness but using the twisted asyncioreactor and then initializing urwid with the Twisted loop which doesn't have this problem. Fixes #1302
* ui: Use Eventloop.create_future instead of asyncio.FutureDylan Baker2018-10-04
| | | | | This is recommended since other implementations can use this hook to return their own Future compatible implementations.
* ui: Drop unneeded _error_handler and rename _error_handler2Dylan Baker2018-07-26
| | | | | | The "2" version was used in non-twisted contexts, now that we don't use twisted we can drop this and rename the "2" variant to the normal variant.
* Drop all use of twisted!Dylan Baker2018-07-26
| | | | | This moves the actual event loop to be the default asyncio eventloop instead of the twisted reactor.
* ui: make apply_commandline a coroutineDylan Baker2018-07-26
| | | | | | This patch is sketchy, it makes the UI start up slowly, and it breaks in a bunch of cases where it get's defereds but asyncio doesn't expect that.
* ui: switch ui.prompt and ui.choice to use asyncio.FuturesDylan Baker2018-07-26
| | | | | | | | | | | asyncio's Futures are much like twisted's Deferreds, they represent a value that is not yet available, and they can be awaited like a coroutine. For the moment we still need to return a deferred because the twisted eventloop doesn't use Futures, it uses Deferreds; once we can remove twisted's eventloop we can remove the conversion from a Future to a deferred.
* ui: Convert apply_command to a coroutineDylan Baker2018-07-26
| | | | | | This is a pretty invasive patch, since the ui code is used so extensively, it requires going into a lot of other code and converting those to coroutines, since before they returned deferred's.
* ui: convert the loop_hook to asyncioDylan Baker2018-07-26
| | | | | | asyncio doesn't have a loopingCall helper, so I've implemented a coroutine that does the same thing, it takes a callable, a period, and then forwards all other arguments. This is tested and working.
* ui: Handle asyncio coroutines in call_cmdDylan Baker2018-07-26
| | | | | | This allows twisted deferred's (which is all an inlineCallback actually is) to be mixed with asyncio coroutines (async def), by wrapping them in a special twisted function for handling asyncio coroutines.
* Use twisted reactor as asyncio event loopDylan Baker2018-07-26
| | | | | | | | This puts the twisted event loop into the asyncio framework. This means that we're currently running all over our twisted.defered's and twisted.inlineCallbacks through asyncio, using the twisted loop. This will allow incremental updates from twisted's event loop to a standard asyncio event loop.
* refactor buffersPatrick Totzke2018-06-19
| | | | | This splits buffers.py, which contained all buffer classes, into several smaller files. issue #1226
* Remove old __future__ importsLucas Hoffmann2018-06-19
| | | | They are not needed for python >= 3.0.
* Wrap long statements on open-bracket syntax.Ben Finney2018-04-23
|
* py3k: Replace 'e.message' with 'str(e)' when handling exceptionsDylan Baker2018-03-01
|
* replace xrange with rangeDylan Baker2018-03-01
| | | | In python 3 xrange is range, to get a list one must wrap range in list.
* repalces uses of dict.iter* with non-iter versionsDylan Baker2018-03-01
| | | | | | | in python3 dict.{keys,items,values} return views, which are similar to iterators without some of the caveats about modifying the underlying object. The iter* and view* methods have been removed, instead one warps dict.x in iter or list to get those types.
* Move screen stop/start logic into context manager.Thomas Nixon2018-02-19
| | | | | | | As well as reducing duplication and adding screen size detection to :pipeto and :pyshell, this ensures that the screen is always restarted, resulting in cleaner error handling if an error occurs while the screen is stopped.
* Merge pull request #1193 from three-comrades/fix_lang_cPatrick Totzke2018-02-10
|\ | | | | Fix `LANG=C alot` with custom bindings.
| * Fix `LANG=C alot` with custom bindings.Julian Mehne2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reproduction steps: - Set a custom binding in your config file. E.g.: [bindings] S = toggletags spam - start alot with LANG=C: LANG=C alot - variant A: type ö - variant B: type :search ö Problem: the urwid encoding is set to 'narrow', such that all key events are passed down as `str`, not `unicode`. At the same time, ConfigObj reads the custom binding as a unicode string. The interaction of both leads to crashes. Related to #673
* | Merge pull request #1172 from Dica-Developer/patch-4Dylan Baker2018-02-08
|\ \ | |/ |/| Fix for issue 1164 - Cannot select key for encryption by number keys
| * * apply code review commentsMartin Schaaf2017-12-12
| |
| * * Extend choice to diffefrentiate between a list of choicesMartin Schaaf2017-11-01
| | | | | | | | and a list of return objects for choices.
* | Merge pull request #1190 from three-comrades/write_historyPatrick Totzke2018-01-28
|\ \ | | | | | | [WIP] Fix writing/loading history, if a command contains non-ascii character(s)
| * | Fix writing/loading history, if a command contains a non-ascii character.Julian Mehne2018-01-10
| |/ | | | | | | | | | | | | | | Bug: - alot -l log -d debug - :search ö<enter> - quit alot - in log file: stacktrace with UnicodeEncodeError, when writing the histfile.
* | Rename get_env to get_xdg_env and clarify docstring.Julian Mehne2018-01-23
| |
* | Fix empty XDG_* environment variables.Julian Mehne2018-01-21
|/ | | | | | | | | | | | Use fallback, if an enviroment variable is unset *or* empty. Bug: - XDG_CONFIG_HOME='' alot Problem: Does not find the configuration file (among others), because os.environ.get('XDG_CONFIG_HOME', '~/.config') returns '', instead of '~/.config'.
* Fix some spelling mistakesLucas Hoffmann2017-09-02
|
* Replace Exception.message with str(Exception)Dylan Baker2017-08-19
| | | | | | In python3 Exception doesn't have a message attribute, the only way to get the string output is to call str() on the Exception. This also works in python 2.7, so go ahead and make that change.
* settings: do not store SettingsManager instance in __init__.pyDylan Baker2017-08-03
| | | | | | | This can create circular imports in unittests, which causes difficult to debug errors. Fixes #1076
* Implement a hook that runs periodicallyDylan Baker2017-01-26
| | | | | | | | This creates a deferred that runs on a user configurable timer and is provided the ui. This deferred will re-fire after the number of seconds specified by the timer are eclipsed. By default this is 300 seconds. Fixes #522
* Merge pull request #984 from lucc/future/absolute-importsLucas Hoffmann2017-01-21
|\ | | | | Use absolute_imports from __future__
| * Use absolute_imports from __future__Lucas Hoffmann2017-01-18
| |