#

"""Parse an OpenSearch for search and autosuggest URLs."""

from __future__ import print_function, absolute_import

import re
from urlparse import urljoin, urlparse
from xml.etree import ElementTree as ET

from bs4 import BeautifulSoup as BS
from workflow import web

from searchio import util

log = util.logger(__name__)

NS = {
    'os': 'http://a9.com/-/spec/opensearch/1.1/',
    'moz': 'http://www.mozilla.org/2006/browser/search/',
}


class OpenSearchError(Exception):
    """Base exception."""


class NotFound(OpenSearchError):
    """No OpenSearch found."""

Exemple #2
0
Options:
    -h, --help   Display this help message

"""

from __future__ import print_function, absolute_import

from docopt import docopt
from workflow import Variables
from workflow.util import set_config

from searchio.core import Context
from searchio import util

log = util.logger(__name__)


def usage(wf):
    """CLI usage instructions."""
    return __doc__


def do_toggle_show_query(wf):
    """Toggle "show query in results" setting."""
    ctx = Context(wf)
    v = ctx.getbool('SHOW_QUERY_IN_RESULTS')
    if v:
        new = '0'
        status = 'off'
    else: