rename the add_handler function everywhere
This commit is contained in:
parent
896ac0a7e9
commit
8354894838
@ -51,6 +51,7 @@ def add_handler(name):
|
||||
"""Add a handler to the qute: scheme."""
|
||||
def namedecorator(function):
|
||||
HANDLERS[name] = function
|
||||
return function
|
||||
return namedecorator
|
||||
|
||||
class QuteSchemeHandler(schemehandler.SchemeHandler):
|
||||
@ -116,7 +117,7 @@ class JSBridge(QObject):
|
||||
message.error(win_id, e)
|
||||
|
||||
|
||||
@addHandler('pyeval')
|
||||
@add_handler('pyeval')
|
||||
def qute_pyeval(_win_id, _request):
|
||||
"""Handler for qute:pyeval. Return HTML content as bytes."""
|
||||
html = jinja.env.get_template('pre.html').render(
|
||||
@ -132,7 +133,7 @@ def qute_version(_win_id, _request):
|
||||
return html.encode('UTF-8', errors='xmlcharrefreplace')
|
||||
|
||||
|
||||
@addHandler('plainlog')
|
||||
@add_handler('plainlog')
|
||||
def qute_plainlog(_win_id, _request):
|
||||
"""Handler for qute:plainlog. Return HTML content as bytes."""
|
||||
if log.ram_handler is None:
|
||||
@ -143,7 +144,7 @@ def qute_plainlog(_win_id, _request):
|
||||
return html.encode('UTF-8', errors='xmlcharrefreplace')
|
||||
|
||||
|
||||
@addHandler('log')
|
||||
@add_handler('log')
|
||||
def qute_log(_win_id, _request):
|
||||
"""Handler for qute:log. Return HTML content as bytes."""
|
||||
if log.ram_handler is None:
|
||||
@ -155,13 +156,13 @@ def qute_log(_win_id, _request):
|
||||
return html.encode('UTF-8', errors='xmlcharrefreplace')
|
||||
|
||||
|
||||
@addHandler('gpl')
|
||||
@add_handler('gpl')
|
||||
def qute_gpl(_win_id, _request):
|
||||
"""Handler for qute:gpl. Return HTML content as bytes."""
|
||||
return utils.read_file('html/COPYING.html').encode('ASCII')
|
||||
|
||||
|
||||
@addHandler('help')
|
||||
@add_handler('help')
|
||||
def qute_help(win_id, request):
|
||||
"""Handler for qute:help. Return HTML content as bytes."""
|
||||
try:
|
||||
@ -189,7 +190,7 @@ def qute_help(win_id, request):
|
||||
return utils.read_file(path).encode('UTF-8', errors='xmlcharrefreplace')
|
||||
|
||||
|
||||
@addHandler('settings')
|
||||
@add_handler('settings')
|
||||
def qute_settings(win_id, _request):
|
||||
"""Handler for qute:settings. View/change qute configuration."""
|
||||
config_getter = functools.partial(objreg.get('config').get, raw=True)
|
||||
|
Loading…
Reference in New Issue
Block a user