From 49803b051e52f48c8c2678fa16a1199e963a218a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 30 Jan 2014 14:58:32 +0100 Subject: [PATCH] Add :crash command --- qutebrowser/app.py | 8 ++++++++ qutebrowser/commands/__init__.py | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 7462765a2..78a0d12f8 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -195,6 +195,7 @@ class QuteBrowser(QApplication): 'yanktitle': self.mainwindow.tabs.cur_yank_title, 'paste': self.mainwindow.tabs.paste, 'tabpaste': self.mainwindow.tabs.tabpaste, + 'crash': self.crash, } handler = handlers[cmd] @@ -222,3 +223,10 @@ class QuteBrowser(QApplication): tab = self.mainwindow.tabs.currentWidget() tab.setUrl(QUrl('about:pyeval')) tab.setContent(out.encode('UTF-8'), 'text/plain') + + def crash(self): + """Crash for debugging purposes. + + :crash command handler. + """ + raise Exception diff --git a/qutebrowser/commands/__init__.py b/qutebrowser/commands/__init__.py index ec6467f92..4f649dcfe 100644 --- a/qutebrowser/commands/__init__.py +++ b/qutebrowser/commands/__init__.py @@ -193,3 +193,9 @@ class TabPaste(Command): """ nargs = '?' + + +class Crash(Command): + """Simply raise an exception for debugging.""" + nargs = 0 + hide = True