Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a qute://configdiff page
  • Loading branch information
The-Compiler committed Sep 15, 2017
1 parent 2e8419d commit 54c4173
Show file tree
Hide file tree
Showing 2 changed files with 770 additions and 1 deletion.
13 changes: 12 additions & 1 deletion qutebrowser/browser/qutescheme.py
Expand Up @@ -34,7 +34,7 @@
from PyQt5.QtCore import QUrlQuery, QUrl

import qutebrowser
from qutebrowser.config import config, configdata, configexc
from qutebrowser.config import config, configdata, configexc, configdiff
from qutebrowser.utils import (version, utils, jinja, log, message, docutils,
objreg, usertypes, qtutils)
from qutebrowser.misc import objects
Expand Down Expand Up @@ -421,3 +421,14 @@ def qute_settings(url):
configdata=configdata,
confget=config.instance.get_str)
return 'text/html', html


@add_handler('configdiff')
def qute_configdiff(_url):
"""Handler for qute://configdiff."""
try:
return 'text/html', configdiff.get_diff()
except OSError as e:
error = (b'Failed to read old config: ' +
str(e.strerror).encode('utf-8'))
return 'text/plain', error

0 comments on commit 54c4173

Please sign in to comment.