mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 18:07:37 +03:00
Merge pull request #2147 from HullSeals/enhancement/2146/cleanup-keyboard-interrupt
[#2146] Cleanup On KeyboardInterrupt LGTM
This commit is contained in:
commit
6c1716ad0a
@ -353,7 +353,12 @@ if __name__ == '__main__': # noqa: C901
|
|||||||
button = ttk.Button(frame, text='OK', command=lambda: sys.exit(0))
|
button = ttk.Button(frame, text='OK', command=lambda: sys.exit(0))
|
||||||
button.grid(row=2, column=0, sticky=tk.S)
|
button.grid(row=2, column=0, sticky=tk.S)
|
||||||
|
|
||||||
root.mainloop()
|
try:
|
||||||
|
root.mainloop()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
logger.info("Ctrl+C Detected, Attempting Clean Shutdown")
|
||||||
|
sys.exit()
|
||||||
|
logger.info('Exiting')
|
||||||
|
|
||||||
journal_lock = JournalLock()
|
journal_lock = JournalLock()
|
||||||
locked = journal_lock.obtain_lock()
|
locked = journal_lock.obtain_lock()
|
||||||
@ -2365,6 +2370,9 @@ sys.path: {sys.path}'''
|
|||||||
# Check for FDEV IDs
|
# Check for FDEV IDs
|
||||||
root.after(3, check_fdev_ids)
|
root.after(3, check_fdev_ids)
|
||||||
# Start the main event loop
|
# Start the main event loop
|
||||||
root.mainloop()
|
try:
|
||||||
|
root.mainloop()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
logger.info("Ctrl+C Detected, Attempting Clean Shutdown")
|
||||||
|
app.onexit()
|
||||||
logger.info('Exiting')
|
logger.info('Exiting')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user