ISISComputingGroup / ISISComputingGroup/IBEX

GUI: Scripts which catch keyboard interrupt with inputs should work

Open
#5,392 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
6
Forks
2
Avg merge
16h 40m
Merged PRs (30d)
2

Description

As a developer I want to write a script such that I catch the keyboard interrupt (ctrl + c) and then can offer an option to the user. Currently this does not work because either the input is ignored or the prompt is not returned to the user. (Only in GUI it works in a console)

Test script:

```
try:
while True: pass
except KeyboardInterrupt:
import time
time.sleep(0.2) # comment line for different effect
a = input("Type something")
print("You wrote {}".format(a))
```

If sleep line is in then prompt is not returned, if it is not then input is not taken.

### Acceptance Criteria

- Script runs correctly (having a sleep in is acceptable)
- Reflectometry script is removed (ctrl + c line 237 in scripts `technique/reflectometry/base.py`)

### Notes

- Similar to #5160 but this might have been fixed

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.