Skip to content
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

API: Capture keyboard interrupt #188

Merged
merged 2 commits into from Jun 27, 2020
Merged

API: Capture keyboard interrupt #188

merged 2 commits into from Jun 27, 2020

Conversation

scottclowe
Copy link
Member

  • Introduce new cli function to inference.py, which contains the previous main function.
  • Add new main which wraps cli in a try-except block, stopping keyboard interruption. A keyboard interrupt message is shown in cyan, detailing the command which was run.
  • Also add keyboard interrupt try-except block to bin/inference.py (which does not utilise colour) in case the program is interrupted while it is importing the modules.
  • Capture KeyboardInterrupt error; show a short message and exit instead of a full stack trace
  • Adding to API: Changes to inference output colors #187, ensure all errors are rendered in red.

- Introduce new `cli` function to inference.py, which contains the
  previous `main` function.
- Add new main which wraps cli in a try-except block, stopping
  keyboard interruption. A keyboard interrupt message is shown
  in cyan, detailing the command which was run.
- Also add keyboard interrupt try-except block to bin/inference.py
  (which does not utilise colour) in case the program is
  interrupted while it is importing the modules.
@scottclowe scottclowe merged commit 675c2ab into master Jun 27, 2020
@scottclowe scottclowe deleted the api_capture-interrupt branch June 27, 2020 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant