add a debug function to work with pdb

This commit is contained in:
Andreas Zweili 2019-02-16 11:33:48 +01:00
parent 3d222e3236
commit 0fa077989d
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,16 @@ class BorgException(Exception):
pass
# This was taken from here: https://stackoverflow.com/a/1745965/7723859
def debug_trace():
'''Set a tracepoint in the Python debugger that works with Qt'''
from PyQt5.QtCore import pyqtRemoveInputHook
from pdb import set_trace
pyqtRemoveInputHook()
set_trace()
def show_error(e):
"""Helper function to show an error dialog."""
message = QMessageBox()