Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vacuum: Implement TUI for the manual mode #845
Vacuum: Implement TUI for the manual mode #845
Changes from 3 commits
6c7de4b
3b3d560
7af3e06
b447676
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When can this happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we import here as
curses
is actually an extension module that must be backed by one of few C implementations of acurses
library.ImportError
occurs when none of the implementations are available on the system.I do not think there is much we can do about it except for mentioning in
docs/vacuum.rst
, thatcurses
lib is a requirement for TUI.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. I thought it is part of the standard library and always available.
How about letting it bubble up and doing the import inside the
tui()
command? It could be caught there to display a user-friendly error message.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I prefer all the
import
s to be grouped in one place - at the top of a module. They are easier to manage that way.If all we want is a prettier error message, I would rather delay the exception until
VacuumTUI
is instantiated:What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what I want is it not to simply crash silently in any case, so your suggested solution works fine, too! Maybe check for the Noneness inside the
__init__
though?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the check to
__init__
in a new commit.