Esempio n. 1
0
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
Esempio n. 2
0
def qute_configdiff(url):
    """Handler for qute://configdiff."""
    if url.path() == '/old':
        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
    else:
        data = config.instance.dump_userconfig().encode('utf-8')
        return 'text/plain', data
Esempio n. 3
0
def qute_configdiff(url):
    """Handler for qute://configdiff."""
    if url.path() == '/old':
        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
    else:
        data = config.instance.dump_userconfig().encode('utf-8')
        return 'text/plain', data